Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Fundamentals - Merging back into master

Tags:

git

I'm new to git.

I made a branch, did my changes, and now I want to merge back to master to make them "permanent".

So I did git merge 1.2 which reported as already up-to-date, did the same on master to the same result, and tried merge -v HEAD master which gave me a slightly different up-to-date message.

So is what I did correct? Should I be doing something else? How do I switch back to the master branch?

like image 402
DVG Avatar asked Aug 03 '11 12:08

DVG


2 Answers

You need to be on the master branch to merge into it.

git checkout master
git merge some_development_effort
like image 171
Šimon Tóth Avatar answered Nov 14 '22 06:11

Šimon Tóth


You have your Master branch and then you have the branch which you are making changes on. In order to merge the branch with changes back into Master you need to be on Master.

So first checkout Master and then run your merge:

git checkout master    
git merge 1.2
like image 24
dmittakarin8 Avatar answered Nov 14 '22 04:11

dmittakarin8