简体   繁体   English

更改Git中的最后提交的作者(远程推送)

[英]Change the author of last commit in Git(pushed remotely)


I am trying to change the author name of last commit. 我正在尝试更改上次提交的作者姓名。 As mentioned in Change commit author at one specific commit , I am executing git commit --amend --author="Author Name <email@address.com>" command. 更改提交作者在某一特定提交中所述 ,我正在执行git commit --amend --author="Author Name <email@address.com>"命令。
In my git log I can see that name and email have been changed. 在我的git日志中,我可以看到名称和电子邮件已更改。
But when I am executing git push -f , it is giving me following error 但是当我执行git push -f ,它给了我以下错误

remote: To prevent you from losing history, non-fast-forward updates were rejected.
! [remote rejected] dev -> dev (pre-receive hook declined)

Any idea how can i push this. 任何想法我怎么能推动这一点。

Thanks, 谢谢,
Shantanu 山塔努

Your remote server is preventing the push. 您的远程服务器阻止了推送。 You need to (temporarily) configure it to permit pushing non-fast-forward changes for that branch to achieve what you want. 您需要(临时)对其进行配置,以允许对该分支推送非快进更改,以实现所需的功能。 How you do that depends on which server you are using; 如何执行取决于所使用的服务器。 for example, if it's a bare Git repository on a server you can change it with git config receive.denyNonFastForwards false . 例如,如果它是服务器上的裸Git存储库,则可以使用git config receive.denyNonFastForwards false对其进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM