Here’s how to change your remote from
Start by checking your current remote:
and this will list your remotes for both
To set a remote, you can use
git remote set-url origin firstname.lastname@example.org:username/project.git
and then use remote again to confirm:
git pull and
git push will work as you expect!
If you are working on git, sometimes you create a branch on one machine, and then want to get that on your remote machine.
Step 1. Create a branch on the remote machine called
git checkout -b rob
Do some work, make some changes, commit some code.
Now I am working on a remote machine in the same repo, but I want my
rob branch. Easy!
fetch just makes sure we are upto date.
branch -v -a lists all remote branches, and provides more information about each. You should see the branch listed as
remotes/origin/rob but you don’t need the
switch allows you to move into the existing remote branch
git branch -v -a
git switch rob