我覺得你的push命令是錯誤的。要推動當地分支機構receiving
(或者無論你怎麼稱呼它:
git push origin receiving:receiving
這應該肯定的工作,這裏有一個例子:
$ git init upstream
$ cd upstream
$ touch foo && git add foo && git commit -m 'initial'
$ git branch receiving
$ cd ..
$ git clone upstream downstream
$ cd downstream
$ >foo echo "downstream change" && git commit -am 'downstream'
$ git push origin master:receiving
$ cd ../upstream
$ git show receiving --
commit …
Author: …
Date: Sun Feb 26 13:40:02 2012 +0100
downstream
diff --git a/foo b/foo
index e69de29..2ba104f 100644
--- a/foo
+++ b/foo
@@ -0,0 +1 @@
+downstream change
$ git log --oneline --decorate --graph --all
* deadbeef (receiving) downstream
* c0ffee11 (HEAD, master) initial
$
相關:http://stackoverflow.com/questions/2147741/git-push-only-for-bare-repositories - 你推送到的分支不是當前簽出的分支嗎? – Mat 2012-01-01 20:58:18
不,我推送到一個分支「接收」,它從來沒有簽出,只存在於接收推送 – ldrg 2012-01-02 23:46:08
爲什麼你推送'origin/receiving'?這是遠程跟蹤分支,它應該指向兩個存儲庫中的相同提交(除非'upstream''' receiving ving'分支已更新,您最近沒有取/拉) – knittl 2012-02-26 12:35:00