GIT: Make commiter on remote server over ssh

How to make fast commit on remote server with keeping an authors of commits and work with one repository by more than one author at same time (or not)? It’s must be simply. Let’s see…

We have a production machines with access to it by user1, user2, etc. or example.
And we need to make the preservation authors of commit.
By some time of googling I’ve found the next solution:

First, we create or add to ~/.bashrc of your user on remote machine next enviromnents:

export GIT_AUTHOR_NAME="YourName" export GIT_AUTHOR_EMAIL="YourEmail" export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
And add the next settings to /etc/sudoers

Defaults env_reset Defaults env_keep += "GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL"
Well, done. Git of course warning you about his not configured variables but author of commit fills completely.
UPD: Removed typo s/COMMITER/COMMITTER/g and git stop warning you (^^,)

Used hrefs:
http://superuser.com/questions/232231/how-do-i-make-sudo-preserve-my-environment-variables
http://cweiske.de/tagebuch/carry-git-settings.htm

Leave a Reply

Your email address will not be published. Required fields are marked *