Labs

Setting the git author on a shared user account

By Dan James | 8th May 2013

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 &quot;you@example.com&quot; git config --global user.name &quot;Your Name&quot; 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=&quot;My Name <me@example.com>&quot;</me@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=&quot;My Name&quot; &amp;&amp; export GIT_AUTHOR_EMAIL=&quot;me@example.com&quot; This works nicely. To save some time, you can put a line like this one in your .bash_profile: alias git-author-myname=&#39;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 :-)

Add new comment