簡體   English   中英

如何在bit-bucket上將我的本地存儲庫與遠程存儲庫合並?

[英]How to merge my local repository with remote repository on bit-bucket?

我正在開發github上提供的open-stack項目。 現在,我的團隊成員在他們的本地系統上下載並在bit-bucket上創建遠程存儲庫,我想與遠程的bit-bucket存儲庫同步。 這樣我就可以在本地系統上獲得更新的存儲庫,我將如何做到這一點。 我已經完成了

[vagrant@localhost horizon]$ git remote rm origin
[vagrant@localhost horizon]$ git remote add origin ssh://git@bitbucket.org/user_name/repo_name.git
[vagrant@localhost horizon]$ git push -u origin master
Warning: Permanently added the RSA host key for IP address '131.103.20.167' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

只需將新的bitbucket存儲庫添加為遠程存儲庫。

git remote add neworigin <bitbucket-repo-url>

然后,您可以獲取並合並,

git fetch neworigin
git merge neworigin/<branch>

如果你需要將其命名origin ,你將不得不重命名或刪除現有的遠程。

您還需要確保已為帳戶添加了SSH密鑰。 請閱讀此處了解如何添加ssh密鑰如果您沒有公鑰。 您可以通過(在主目錄中的.ssh目錄內)生成它,

ssh-keygen -t rsa -C "hello@world.com"

UPDATE

您正在使用ssh協議,請使用https網址。 然后它會詢問您的用戶名和密碼。

您可以使用TortoiseHG或SourceTree工具將遠程存儲庫與本地同步

請參閱此鏈接以在本地克隆它

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM