在Git中推拉分支 [英] Push and pull branches in Git

查看:128
本文介绍了在Git中推拉分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个本地存储库,我正在使用它的远程存储在GitHub上。我最近创建了一个分支并开始研究它,进行了几次提交,现在希望将该分支推送到GitHub并能够将其分支到另一个克隆的存储库。

I have a local repository I'm working on and its remote is hosted on GitHub. I recently created a branch and started working on it, making several commits and now wish to push the branch to GitHub and be able to pull it to another cloned repository.

什么需要做到这一点?

如果使用GitHub无法实现,我很乐意知道如何正常执行。

If this is not possible using GitHub, I'd be happy to know how to do it normally.

推荐答案

git push origin <local-branch-name>:<remote-branch-name>

替换< local-branch-name> < remote-branch-name> 。您可能会相同或不同。

Substitute for <local-branch-name> and <remote-branch-name>. They may be same or different, as you wish.

这篇关于在Git中推拉分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆