1

We're two programmers working off of a "central" git repository. We're both pushing to the same "master" branch on the central repository.

Yesterday I pushed a bunch of commits and the other programmer later pulled them.

Now git is showing him all of my commits from yesterday as out commits ready to be pushed from his machine to the central repository.

We're not quite sure how to handle this, and I haven't found any discussions on similar situations.

Note that we're both on Windows, using GitExtensions, TortoiseGit and msysgit 1.6.5.1. The central repository is on ProjectLocker.

shovavnik
  • 2,878
  • 3
  • 24
  • 21
  • are you both logged into git with the same credentials? Or do you have the same names? – Bnjmn Mar 02 '11 at 07:41
  • Do you have some automatic conversion going on like an autocrlf set to true? http://stackoverflow.com/questions/2825428/why-should-i-use-core-autocrlf-true-in-git/2825829#2825829 – VonC Mar 02 '11 at 07:47
  • @Bnjmn, we are not logged on with the same credentials. Each of us has his own set of keys. – shovavnik Mar 02 '11 at 07:51
  • @VonC, funny you should mention that. Actually, we had some other issues a couple days ago which we resolved by setting autocrlf to 'false'. I didn't consider that the issues might be related. – shovavnik Mar 02 '11 at 07:55
  • @shovavnik: I am not sure if they are, but that can change files when importing them, so... what do you mean with "git is showing him all of my commits from yesterday as out commits ready to be pushed from his machine to the central repository": what does his '`git status`' reports exactly? – VonC Mar 02 '11 at 08:49
  • @VonC, I'll get the exact report from him and post it here. Also, what @vedang suggests makes sense. Could be it's all good and I'm just too new with git. It may take a few hours until I can get in touch with my coworker. – shovavnik Mar 02 '11 at 09:23
  • @VonC, it turns out vedang had the right of it. This time :) the problem was simply that I didn't know what to expect and had nothing to do with whitespace. Thanks for your help! – shovavnik Mar 03 '11 at 09:49
  • @shovanik: excellent, you figured it out :) +1 for vedang's answer. – VonC Mar 03 '11 at 10:13

1 Answers1

1

Did you do a git log on your friend's machine and check if git really thinks that they are his commits? Actually, I think all that has happened is that he made some diverging commits before he pulled your code into his local repository. It means that when he pushes from his machine to the central repository, the history of the central repository will be altered to look like the out commits that you are seeing.

Please do a git log to see the commit author for each of the commits.

vedang
  • 3,111
  • 2
  • 24
  • 33
  • That makes sense. Git is showing the commits as my commits, not his, so I guess everything is good. My friend will push as soon as he can, and I'll let you know how it goes. – shovavnik Mar 02 '11 at 08:28
  • we played around with it a bit and finally just pushed the changes. Coming from Subversion, I hadn't realized that git rewrites history in ordinary use cases. I thought it only did it if I **ask** it to, but I now see that git's solution is actually the simplest. Thanks! – shovavnik Mar 03 '11 at 09:52