在rewriting the commit tree to rename the author and change the email之后,我的本地仓库和远程来源不同步。我是唯一的开发人员,并希望将我的本地仓库推送到原点,将origin / master更新到我的本地主分支。这是我尝试过的,没有取得任何成功:
LibGuest08@LBP-NW0345QZMH1 /e/devel/src/java/bbct (swing.0.5.2)
$ git push
Password:
To ssh://codeguru@git.code.sf.net/p/bbct/code
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration
hint: variable to 'current' or 'upstream' to push only the current branch.
LibGuest08@LBP-NW0345QZMH1 /e/devel/src/java/bbct (swing.0.5.2)
$ git push origin master:master
Password:
To ssh://codeguru@git.code.sf.net/p/bbct/code
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
LibGuest08@LBP-NW0345QZMH1 /e/devel/src/java/bbct (swing.0.5.2)
$ git push -f origin master:master
Password:
Counting objects: 464, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (148/148), done.
Writing objects: 100% (452/452), 470.65 KiB, done.
Total 452 (delta 268), reused 417 (delta 247)
remote: error: denying non-fast-forward refs/heads/master (you should pull first)
To ssh://codeguru@git.code.sf.net/p/bbct/code
! [remote rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'
LibGuest08@LBP-NW0345QZMH1 /e/devel/src/java/bbct (swing.0.5.2)
$
我也按照建议拉出了原点,但是它与所有提交合并,其中一些提交有错误的作者姓名和电子邮件。如何将我的远程源repo与我的本地repo同步并删除所有带有错误元数据的提交?
更新
我在Sourceforge repo中编辑了配置文件。我仍然收到错误消息,但我注意到另一行:
lib_lab_ref08@LBP-REF87XVMDP1 /e/devel/src/java/bbct (master)
$ git push -f
Password:
Counting objects: 464, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (148/148), done.
Writing objects: 100% (452/452), 470.65 KiB, done.
Total 452 (delta 268), reused 417 (delta 247)
fatal: Unable to create temporary file: Permission denied
error: unpack failed: index-pack abnormal exit
To ssh://codeguru@git.code.sf.net/p/bbct/code
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'
什么是
fatal: Unable to create temporary file: Permission denied
error: unpack failed: index-pack abnormal exit
意思?更重要的是我该怎么做才能解决这个问题?
经过深思熟虑:
我正在使用公共电脑。我最近压缩了我的repo数据库,我猜我没有权限写入临时文件夹,其中git在推送期间解压缩压缩的repo对象。我会在没有这些安全限制的计算机上尝试这个,看看会发生什么。
答案 0 :(得分:6)
远程存储库上有一个设置阻止(并且它是一件好事)非快进推送,这就是你正在进行的推送类型。
当你指出你非常安全地进行非ff推送是因为你是唯一一个使用它的人,所以请参阅this blog post以了解如何更改它:
ssh -t USER,PROJECT@shell.sourceforge.net create
/home/git/p/<project_name>/code.git
(填写正确的项目名称)vi
修改配置文件,并将denyNonFastforwards
设置为false