Quantcast
Channel: floatingfrisbee – Code On A Boat
Viewing all articles
Browse latest Browse all 14

Mapping a local branch to a remote branch in GIT

$
0
0

If you’ve created a git repository using the following steps:

  1. Created a local git repository using “git init .”
  2. Created a remote repository on github.com or another host
  3. Added that remote to the local repository using “git add remote origin <path to remote repo>”

Then you might be in a state where your local master is not mapped to the remote master. To fix that run the following command:

git branch --set-upstream master origin/master

I suspect that in step 3 there could be a way to specify the mapping so it doesn’t have to be done later explicitly, but I’m not aware of it currently.



Viewing all articles
Browse latest Browse all 14

Trending Articles