簡體   English   中英

Git將分支更改推送到另一個存儲庫

[英]Git push my branch changes to another repository

我在Git存儲庫中,並且在我的分支中有一些提交。 我只需要將該分支的更改推送到另一個遠程存儲庫中。 我該如何實現?

我已經嘗試過命令git push git@bitbucket.org:XXX/XXX.git launchpad-issues

此命令可推送整個存儲庫,但我希望僅將更改推送到一個分支上。

您可以將另一個遠程添加到本地git,然后推送到它。 假設您要推送foo分支

# Add another remote called 'my-other-repo'
git remote add my-other-repo git@bitbucket.org:XXX/XXX.git

# Push the foo branch to my-other-repo
git push my-other-repo foo

而且,如果您願意,可以選擇以后刪除遙控器

git remote remove my-other-repo

暫無
暫無

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

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