Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging Git Branches

Tags:

git

aptana

I have two branches, one is the master, one is 'test.' This name was dual-purpose, I was not only testing the branches, but testing out some changes as well. Now, I have the test branch working great. However, I am not working alone. The master branch is being worked on too. Now, I would love to copy my test branch over to the main. Then, I would love to do a pull and see what changes have been made so I can push the changes.

First, I am using Aptana. I tried the drop-down settings button. I clicked and attempted to merge while on the Master branch with the 'test' branch. This did something, not really sure what. It then said I had a problem. So, now, I ran git mergetool, and again, this did something. It said everything was good.Now, the two branches are both working as they should, however, they are not identical. In fact, they are both exactly what they were before any merge took place.

What can I do to fix this? 'test' is the important branch right now, it has all my work. Master has some important stuff, but not locally. Any suggestions would be great.

like image 305
Serodis Avatar asked Apr 15 '11 03:04

Serodis


1 Answers

First of all, commit and push every change in both branches.

Then, checkout to master, and merge test:


$git checkout master
$git merge test

It should display warning on every file that has a problem with merging. Sometimes Git can't figure out the "right" merge and you have to manually fix it. Go to those files, check for merge problems (they're easy to guess, Git wraps problems in <<<< ==== >>>>) And that's it! You have successfully merged test on master. Hope it helps!

like image 109
fedeisas Avatar answered Oct 05 '22 22:10

fedeisas