I have a project I forked on github to my repository. I made changes on the “experiment” branch of the project the committed the project to my fork. If you go to my branch on Github you can see the that the experiment branch was correctly committed. I would like to merge the experiment branch with the original repo (which I have rights to). I issued the following commands:
git clone git@github.com:originalrepo/theproject.git
git checkout -b experiment origin/experiment
cd theproject
git remote add experiment git@github.com:chumofchance/theproject.git
git fetch experiment
git merge experiment
"Already up to date"
However, when I view the project in explorer, it appears that nothing has changed. Am I screwing something up in regards to fetching the experiment branch (vs the master branch)?
(As a very minor point, I guess you really did the
cd theprojectbefore thegit checkout.)I think you may have created some confusion by calling the remote that refers to your repository on github the same as the branch into which that you’re wanting to merge.
The last line actually just merges the
experimentbranch into theexperimentbranch, which obviously doesn’t make any changes. You probably instead wanted to do something like:… instead.
Just to make it clearer, I would call the remote that refers to your repository something different, just to keep the idea of a branch and a remote more separate. For example:
At this stage,
git branch -rshould show you all the branches frommyforkedrepothat have just been fetched asmyforkedrepo/master,myforkedrepo/foo,myforkedrepo/experiment, etc. Just pick one of them to merge, e.g.