Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using git with etckeeper.

When I use sudo git to commit changes in /etc/, GIT_AUTHOR_NAME & GIT_AUTHOR_EMAIL from my env are used (as intended).

When I use sudo apt-get and changes are auto-commited, the local username@host is used instead.

Why the change in behavior and how can I make sudo apt-get use the ENV vars?

share|improve this question

Looks like this is fixed in etckeeper 1.5 :)

It was happening in /etc/etckeeper/commit.d/50vcs-commit

if [ "$VCS" = git ] && [ -d .git ]; then
  if [ -n "$USER" ]; then
    export GIT_AUTHOR_NAME="$USER"
    export GIT_AUTHOR_EMAIL="$USER@$hostname"
  if [ -n "$logfile" ]; then
    git commit $GIT_COMMIT_OPTIONS -F "$logfile"
    git commit $GIT_COMMIT_OPTIONS
[ ... ]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.