Category Archives: author

Git authenticated pusher name as author

Hello dear stackoverflow community)

Recently I managed to set up git server with Smart HTTP over Apache web server and LDAP authentication. Authentication is held correctly but I also want to make git show LDAP username as a committer (author) instead of name stored on client git repo. How this can be done?

Step 1. I commit somthing

git commit -m "Some message"

Step2. I push it to server

git push
//git prompts me for user name and password
Username for http://some.server.com: user1
Password for http://some.server.com: *******
//Pushed successfully

Step 3. I commit something else

git commit -m "Some other message"

Step 4. I push it to server but as another user - SomeOtherUser

git push
//git prompts me for user name and password
Username for http://some.server.com: SomeOtherUser
Password for http://some.server.com: **********
//Pushed successfully

Step 5. Browsing git log

git log

Author: git_client_user<[email protected]>
Date:   Tue Oct 6 12:34:54 2015 +0200

    Some other message

Author: git_client_user<[email protected]>
Date:   Tue Oct 6 10:59:25 2015 +0200

    Some message

However I was authorized as different users git thinks that commit was made by a single person - git_client_user, andI need to distinguish commits even if they were one from single computer but with different credentials.

Thanks.