Friday, January 23, 2026

How to change git origin for repo after making a copy of the repo

 1) Locally  run the following commands for the existing repo:

                        git remote -v

This will help us find the current remote origin

2) Set remote origin to the new repo:

                    git remote set-url origin git@gitlab.com:folder/repo.git

3) Locally ensure that it is in the correct branch

                    git checkout import-main

4) if activities were done in a new branch, merge it with the current branch "import main"

                                                  git merge main

5) push the code to the git


                        git push

No comments:

Post a Comment