8th May 2013

Setting the git author on a shared user account

Dan James
Senior Developer

Because Acquia servers only provide a single user account for everyone, if you use Acquia Livedev to code directly on the development environment when you come to do a git commit you will be asked to provide author details: user@host ~/dev/livedev/docroot/ $ git commit *** Please tell me who you are. Run git config --global user.email "[email protected]" git config --global user.name "Your Name" Which sucks, since multiple people are going to be doing commits from one account, and we want to know who's who. To get around that, you can provide the --author argument: git commit --author="My Name "@example.com> But that's a pain, because you will forget to do so and each time you commit you'll have to remember that argument. Instead, you can set a couple of environment variables, which are only good for your session: export GIT_AUTHOR_NAME="My Name" && export GIT_AUTHOR_EMAIL="[email protected]" This works nicely. To save some time, you can put a line like this one in your .bash_profile: alias git-author-myname='export GIT_AUTHOR_NAME="My Name" && export GIT_AUTHOR_EMAIL="[email protected]"' Then, when you login, just run git-author-myname to become the author of all of your commits for that session :-)