2016-01-07 36 views
1

我想從git repo A克隆一個分支到新的git repo B.傾向於包含所有提交歷史記錄。如何將一個具有提交歷史的分支複製到另一個新的回購?

以下所有內容均正確:http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/。但是當我嘗試推送到遠程時,發生錯誤。

remote: ERROR: invalid comitter email: [email protected] 
... 
remote: valid email addresses: 
... 
remote: error: hook declined to update refs/heads/mybranch 
To ssh://[email protected]/myrepo.git 
! [remote rejected] mybranch -> mybranch (hook declined) 
error: failed to push some refs to 'ssh://[email protected]/myrepo.git' 

我知道所有過去的提交都是由另一個人完成的,他不在有效的電子郵件地址列表中。如何忽略這種驗證?有沒有其他方法可以做到這一點?

UPDATE

要求我們的管理員改變遠程設置。現在一切正常。從git-push documentation

git push --no-verify 

回答

-1

你應該忽略鉤

--[no-]verify Toggle the pre-push hook (see githooks[5]). The default is --verify, giving the hook a chance to prevent the push. With --no-verify, the hook is bypassed completely.

編輯由@torek指出,標籤[遠程拒絕]表明,問題就來了從遠程。所以在本地設置標誌不會有幫助。您需要查看您的git.internal服務器上的設置。

+0

git push --no-verify 錯誤:未知選項'no-verify'任何想法爲什麼? – BAE

+0

可能你的git版本太舊了......你有什麼版本? –

+0

不,哪個git版本號;使用'git --version'。版本1.8.3.2中增加了選項'--no-verify'。 –

相關問題