将分支推到Git [英] Push branches to Git

查看:73
本文介绍了将分支推到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.

什么需要完成这项工作吗?

What needs to be done to accomplish this?

如果使用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> <远程分支名称> 。根据您的需要,它们可以相同或不同。

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

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

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