I'm a git noob, and I know I'm missing something fundamental here. I've got three branches: master, feature1 and feature2. No two branch is identical, yet any attempt to merge from one branch to the other results in an "up-to-date" message. As you can imagine, I've done my work on feature1 and feature2, and now I just want to merge that work back into my master.
Here is what my current graph looks like:
* c719e79 master
|\
| * 3f38259 feature2
| * 4e2af8c
| * a6ee18c
| * 2339052
| * 2e31d49
| * 2586659
| * 8b4a194
| * 56200c1
| * 97598e3
| * c28bc8d
| * 68b2e2f
| * 1ad4ad8
| * 3d5f4ad
| * 83435ca
| * 4049428
| * 581134a
| * 6e5aa2d
* | 2c88093
|/
* 3130ec9 feature1
* 54a5311 INITIAL COMMIT
Any ideas?
UPDATE
VonC - the explanation makes sense, but my git repo still doesn't. When I switch over to my master branch and then run "$ git diff --stat feature2", I get the following output:
$git diff --stat feature2
File1 | 2 +-
File2 | 6 +++---
File3 | 4 ++--
File4 | 2 +-
File5 | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
I get an even longer list of files if I run the same command for feature1. So... I still have it telling me that I'm up-to-date, but the files in each branch are different.
UPDATE 2
@Scott - Okay, I think your response has helped clarify my problem a little. I understand that merging will not make all the branches identical, but will simply update the branch that I'm on.
However, it appears that my commits have gotten "out of order", or something. In other words, there are changes that exist on the feature2 branch that I want to appear on my master branch. Git must think that version of the files on my master branch are the "right" ones (whatever that means). How do I get Git to commit the differences on feature2 branch to my master branch when it thinks that the changes currently on master are the latest and greatest?
UPDATE 3 (final)
Well, I'm very grateful to all of you who tried to help me out. I figured out a work-around that solved it just as well, but I never actually figured out how to do what I had in mind.
After thinking through some of your comments, I did a rebase. The graph of the commit history was a straight line like you would expect. The trouble didn't go away, though: my feature2 branch was behind master by one commit, but it contained code that actually made it the branch with the "latest and greatest" code. Trying to merge the branches did nothing. Finally, I just decided to create a new branch off of my feature2 branch and called that "latest". So I guess, in the end, I'm grateful for how easy it is to branch with git. But it's clear that I'm missing something...
Thanks again, everyone.