1

My branch head is rejecting my pushes to the branch.

remote: Resolving deltas: 100% (20/20)
To http://foo.bar@git.xxx.com:8080/git/PHP/Synco.git
! [remote rejected] master -> master (fecb4b4761ab187b15a576a1adf44ab0648dab5e by Foo <foo.bar@xxx.com> was not committed by Foo Bar (foo.bar) <Foo.Bar@xxx.com>)
error: failed to push some refs to 'http://foo.bar@git.xxx.com:8080/git/PHP/Synco.git'

I have this issue. Though I tried to take clone back and tried push again but have same issue. How can I resolve keeping my dev code safe.

Sankalp
  • 1,300
  • 5
  • 28
  • 52
  • It is actually not clear what you are trying to do. Did anybody else pushed and you are trying to push without pulling before? – ckruczek Jun 01 '15 at 05:50
  • I have commited my code taken pull from origin as well. But when I tried to push my changes to master I get this error on git push command. – Sankalp Jun 01 '15 at 05:53
  • And did you pulled from master as well or to a different branch? – ckruczek Jun 01 '15 at 05:55
  • Did you fetch origin and merge before trying to push? – Winny Jun 01 '15 at 05:57
  • at Ckruczek. I am novice not familiar with branch as well so I work on master only. at Winny- No please, Can you elaborate more. I will do. – Sankalp Jun 01 '15 at 05:59

1 Answers1

3

According to the error message it looks like there is a hook to check user name and e-mail. And they don't match it seems.

Foo <foo.bar@xxx.com> was not committed by Foo Bar (foo.bar) <Foo.Bar@xxx.com>)

Try changing your user name and email and do the commit with this configuration.

git config --global user.email "Foo.Bar@xxx.com"
git config --global user.name "foo.bar"
Sankalp
  • 1,300
  • 5
  • 28
  • 52
crea1
  • 11,077
  • 3
  • 36
  • 46
  • Nopes I tried before to change configuration. But I have same issue. – Sankalp Jun 01 '15 at 06:01
  • Did you do the configuration changes before making the commit? Changing the configuration after you've made the commit will not make any difference as the commit already have the author from the previous configuration. – crea1 Jun 01 '15 at 06:06
  • No I commited before and did configuration changes after your suggestion. Can you please help how to do it back. – Sankalp Jun 01 '15 at 06:08
  • Check the answer to this question: http://stackoverflow.com/questions/3042437/change-commit-author-at-one-specific-commit – crea1 Jun 01 '15 at 06:23
  • @Sankalp If the repository has these kinds of hooks, somebody explicitly put them there. Could you ask them directly? – Thorbjørn Ravn Andersen Jun 01 '15 at 07:32