Git_01_push失败之解决办法

从本地服务器向云端服务器提交代码的过程中,碰到了以下问题:

  • 提示账号没有push权限
root@localhost:~/repo/$ git push qnx HEAD:refs/for/develop
Counting objects: 29, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (29/29), done.
Writing objects: 100% (29/29), 12.95 KiB | 6.48 MiB/s, done.
Total 29 (delta 11), reused 1 (delta 0)

remote: Resolving deltas: 100% (11/11)
remote: Processing changes: refs: 1, done
remote: ERROR: commit 72a9a5e: email address *@*s  not registered in your account, and you lack 'forge committer' permission.
remote: The following addresses are currently registered:
remote:    *@*
remote: To register an email address, visit:
remote: */*
remote:
remote:
To ssh://*/*
 ! [remote rejected] HEAD:refs/for/develop
error: failed to push some refs to 'remote'
  • 修改办法
  1. 修改账户邮箱
root@localhost:~/repo$ git config --global user.email *@*.com
  1. 重置仓库提交历史,修改提交人邮箱
root@localhost:~/repo$ git commit --amend --reset-author
  1. 完成上述操作后,重新push,即可成功。
  • 问题产生原因
    使用了mobaXterm工具中bash session窗口向本地git仓库中提交了代码,其使用的用户,用户邮箱与git仓库原有账户和账户邮箱不一致,因此造成了push失败的问题。

你可能感兴趣的:(Tools,git)