Changing the Origin in Git–#SQLNewBlogger
source link: https://voiceofthedba.com/2024/01/03/changing-the-origin-in-git-sqlnewblogger/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
I needed to show a customer how to migrate from Azure DevOps to GitHub recently, and to smooth this process, we needed to repoint the origin remote.
Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. You can see all posts on Git as well.
Changing the Remote
When you want to see remotes, you run this code:
git remote –v
As you can see, I have my origin pointed to Azure DevOps..
Now, I can delete and add back the origin remote if I want, but there is an easier way. I’ll use the set-url parameter with this code:
git remote set-url origin https://github.com/way0utwest/DatabaseDevOpsMS.git
This points the origin to my new remote in GitHub. Once I run this, I’ll set the branch and push, as the GitHub repo is empty. This pushes everything to GitHub and voila, I’ve got code there.
You can see this online
SQL New Blogger
I had to write this up in more detail for a customer as documentation. You might do this at work for someone, but I grabbed this focused, small piece of this and created my own blog, reusing a few screenshots.
Note: Don’t reuse screenshots of company assets. Recreate this in your own space.
This took me only about 5 minutes to write up after the other work was done. You could easily do that.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK