Let me start off by saying I’m a huge Git (and Ubuntu) noob. I will try and explain my problem as clear as possible, but I find this hard, because I’m not really sure of what I’m doing or if I’m using the right approach.
Here’s the situation:
I have a remote Ubuntu server with a bare repo (/opt/git/repo.git). I have two users on my server: bram and test, both are in the group git. Git has write access to the directory. Both users have a different name and email configured with git config --global. The contents of /home/bram/.gitconfig:
[user]
name = Bram Van der Sype
email = ...
[core]
editor = vim
Contents of /home/test/.gitconfig
[user]
name = Test test
email = ...
On my local machine (Windows 7) I have 2 clones of the repo: one actual development repo, that was checked out with bram and a second clone (for testing purposes only, in a different directory) that was checked out with test.
What did I do:
Changed some lines in a file in the second, test clone. I then committed these lines locally and pushed them to the origin (using SSH, I am asked for the test password). I switched to the actual development directory, did a git pull origin master and opened the changed file. I see the changed lines done in the testing dir. I then do a git log -2 and git blame index.php, hoping to see the user.name associated with test linked to the commit and the changes.
However, the only name I see, is the bram one.
What do I want?
To be able to see who did the actual commit. Is this something I can do with gitosis (something I saw mentioned when googling)? Did I configure something wrong? Will I need to commit from another machine/Windows user account? Any help, instructions or references to documentation are more than welcome!
When you commit your changes you need to be logged in as that particular user. It doesn’t matter who cloned the repo. I suspect you were logged in as bram when making changes to the test repo.