I am having my first experience merging someone else’s changes with Git (as opposed to just cloning/pushing by myself in a trivial way.) I used git pull and the basic process of conflict resolution was simple enough, that bit seemed to work fine.
I’m a little confused at what I’m seeing, though. I’m sure this is a very simple question. But why is it that after I pull and merge someone’s changes from the master, it’s showing those files as being “staged” in my branch…even when I didn’t touch the files at all?
For instance: the other person added a brand new PNG to the project. That PNG shows up as being “Added” when I do git status. I didn’t do git add, the merge put it there automatically. Is everything actually working properly and this isn’t going to wind up looking like it’s coming from my commit? Will there be some sort of diff magic coming in when I commit and push?
Remember, a pull is just a fetch + a merge.
You need to commit a merge. This results in something called a merge commit. The merge commit will have as parents both your latest revision and the revision that you just pulled. The files are shown as staged since they are going to be included into the merge commit.
Try running
git commitand then looking at the resulting history with e.g.gitk.You can read more about merges for example in the Git Book.