Monday, June 20, 2011

Git ---- denied: You cannot push changes not committed by you

If you get the PERMISSION DENIED error when try to push to a remote server, check the followings:
  • The author name and email should be the same as your git profile.
Expecially, the author name is FULL NAME of your profile on git server.

  • If you are using Linux, you also need to setup committer name and email to the same as git profile. otherwise, it will be youid@your_linux_host by default

To fix the permission problem:

>export GIT_COMMITTER_NAME="Your Fullname"
>export GIT_COMMITTER_EMAIL="Your Email"
>export GIT_AUTHOR_NAME="Your Fullname"
>export GIT_AUTHOR_EMAIL="Your Email"

//to back out the commit and index
>git reset HEAD^
//recommit and push again
>git commit
>git push