Home > git > Git merging

Git merging

OK, so maybe you can see a bit of a pattern here. I’ve been messing with git trying to get to the point where I can do what I want with it. Now that I understand how the branching functions, the next step was figuring out how to merge.

First thing to note is that this is how you can see the file differences in the two branches:
git diff ––name–status master..branch
Other views of the data:
git diff master..branch
git log master..branch
git shortlog master..branch

So that covers what the differences are between the branches before merging. Then there’s the real merging.
git merge branch ––no–commit

Then you can look at the changes with:
git status
git diff

If you see any problems you can turn back the clock with this:
git reset ––hard

Categories: git Tags:
  1. Mike
    June 22nd, 2009 at 10:36 | #1

    I think the double dashes (–) got turned into em dashes. Other than that, this works great. Thanks.

  2. June 23rd, 2009 at 17:24 | #2

    Ya, you’re right. Something in the system is modifying double-dashes to em dashes somewhere down the pipe. I just changed them to en-dashes so it’s at least clearer to read.

  1. No trackbacks yet.