I set up a GitHub project (origin
).
I then cloned this repo into a bunch of different machines (ex. my local computer, a production environment, a staging environment, ect).
I make changes on my local machine, and push to origin
.
Eventually, I merge my development branch into origin/master
.
I then want to pull these changes from origin/master
into my production environment, so;
root@production$ git --version
git version 1.7.9.5
root@production$ git remote
origin
root@production$ git branch -r
origin/HEAD -> origin/master
origin/master
...
from here, I've tried everything;
git fetch
git checkout master
----------------------------------
git checkout origin/master
----------------------------------
git checkout -b origin/master HEAD
But none of them worked (ie, the changes were never reflected). It wasn't until I did
git pull origin master
that it finally worked. But I don't understand why I can't just checkout the master? Everything I'm reading on SO says to use checkout
(git checkout remote branch
) - I don't get it :S