You might need to consult the help documentation for your chosen application however I have provided a couple of Screenshots below as examples to give an idea of what this might look like. If you like to use a Graphical git tool, like most people who value their sanity, then you will find this should be very straightforward to do. Git remote remove old-origin Using a git GUI Once you're happy your commits have been push up to 'origin' at the new url you can delete the 'old-origin' or whatever you decided to rename it to.if you add -all to the push command it will not only push your current branch but all branches, if you wish to do so. The -u is the same as -set-upstream, this sets this new origin as the upstream remote for the branch you are pushing from now on. Push your branch to the newly configured 'origin'.If you want to use the HTTP protocol it will look like this. Git remote add origin the git user before the sign in the SSH url must now be 'git' not 'gitlab' If you want to use the SSH protocol it will look like this. create new remote called 'origin' with the new project URL:.rename current 'origin' to something else:.This is broken down into simple steps below. Once you have confirmed the name of the remote repository you want to edit, the simplest thing to do is rename it to something else (as we can't have 2 remotes with the same name) create a new remote with the correct URL and then once you are happy you have pushed to the new remote you can delete the old one you renamed. The above were cloned using SSH, if you cloned using HTTP they will look as below: git remote -vĪnother way to check is to use the git remote show command to look at more detailed config settings for a chosen remote. Run the command git remote -v to list the configured remote repos and their associated URL's: git remote (push) If it is not called 'origin' it will be because you have changed it to something else, in which case you probably know your stuff and won't be needing this guide □ From the command line So in 99.9% of cases you will find the remote you want to update is called 'origin'. When you clone a project it will automatically create a remote called "origin" at the address you cloned it from. To do this you will need to edit the remote called "origin". If you have made changes to your local git repo that you want to keep and push back up to GitLab you will need to tell your local git repo the new url for the gitlab server. When you clone a project it will automatically create a remote called "origin" at the address you cloned it from.įor when you have local commits/changes you wish to keep If you don't have any local changes in your git repo that you wish to keep, you could just delete your local repository and take a fresh clone from gitlab the same way you would usually clone a gitlab project. In December 2021 Surrey's Gitlab Service will be changing its URL from .uk to .uk.Īs part of this change you will need to update the url of the 'remotes' for any of your local copies of git projects you have cloned from .uk.
0 Comments
Leave a Reply. |