2012-09-16 87 views
4

rewriting the commit tree to rename the author and change the email後,我的本地回購和遠程原點不同步。我是唯一的開發人員,並且希望將我的本地倉庫推到原點,將origin/master更新到我的本地主分支。以下是我已經沒有任何成功的嘗試:移動遠程分支

[email protected] /e/devel/src/java/bbct (swing.0.5.2) 
$ git push 
Password: 
To ssh://[email protected]/p/bbct/code 
! [rejected]  master -> master (non-fast-forward) 
error: failed to push some refs to 'ssh://[email protected]/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. 

[email protected] /e/devel/src/java/bbct (swing.0.5.2) 
$ git push origin master:master 
Password: 
To ssh://[email protected]/p/bbct/code 
! [rejected]  master -> master (non-fast-forward) 
error: failed to push some refs to 'ssh://[email protected]/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. 

[email protected] /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://[email protected]/p/bbct/code 
! [remote rejected] master -> master (non-fast-forward) 
error: failed to push some refs to 'ssh://[email protected]/p/bbct/code' 

[email protected] /e/devel/src/java/bbct (swing.0.5.2) 
$ 

我還拉出身的建議,但是,做了合併與所有提交,其中有一些錯誤的作者姓名和電子郵件。我如何將我的遠程原點回購與我的本地回購同步並刪除所有提交的不良元數據?

更新:

我編輯在Sourceforge的回購的配置文件。我仍然得到錯誤信息,但我注意到一個不同的線路:

[email protected] /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://[email protected]it.code.sf.net/p/bbct/code 
! [remote rejected] master -> master (n/a (unpacker error)) 
error: failed to push some refs to 'ssh://[email protected]/p/bbct/code' 

是什麼

fatal: Unable to create temporary file: Permission denied 
error: unpack failed: index-pack abnormal exit 

是什麼意思?更重要的是,我該如何解決這個問題?

左思右想:

我使用的公共電腦。我最近壓縮了我的repo數據庫,並且我猜測我沒有權限寫入臨時文件夾,git在推送過程中解壓縮壓縮的repo對象。我會在沒有這些安全限制的計算機上試試這個,看看會發生什麼。

+0

它看起來像遠程拒絕非ff通過鉤子推,所以沒有什麼可以做 – CharlesB

+0

此外,錯誤消息中的是鉤子拒絕我的推動線索? –

+0

是錯的,它不是一個鉤子,而是一個回購設置,所以沒關係,看到我的回答 – CharlesB

回答

6

遠程存儲庫上有一個設置可以防止(這是一件好事)非快進推送,這是您正在執行的推送類型。

正如你指出你的安全做非FF推,因爲你是唯一一個與它的工作,所以看this blog post,看看如何改變它:

  1. 日誌到SSH殼與ssh -t USER,[email protected] create
  2. 導航到混帳回購協議:cd到/home/git/p/<project_name>/code.git
  3. 編輯配置文件(在正確的項目名稱填寫)與vi並設置denyNonFastforwardsfalse
+1

emacs emacs emacs = p –

+0

hmm ...我仍然收到相同的錯誤信息。我會更新我的問題。即使使用'-f'標誌也可以使用 –

+0

? – CharlesB