如何使用 git 推送到 bitbucket 上的特定分支
How to push to a specific branch on bitbucket using git
我明白命令
git push <url>
是你应该用来推送的,但据我了解,它只是推送到主分支。我如何推送到这个项目的不同分支。谁能解释一下这是如何工作的,因为我不明白?
git checkout -b branch1
创建并签出分支 branch1
做你的工作,git add
,git commit
等等
git push origin branch1
推送到名为 branch1
的分支
最好的快速指南在这里
http://rogerdudler.github.io/git-guide/
您可以在命令中指定分支的名称。
喜欢,
git push origin your_branch
它将本地系统中的 your_branch
分支推送到远程计算机中的 your_branch
。
但是如果你想将一个名为 your_local_branch
的分支推送到一个名为 your_remote_branch
的远程分支,那么你应该输入 -
git push origin your_remote_branch:your_local_branch
.
我明白命令
git push <url>
是你应该用来推送的,但据我了解,它只是推送到主分支。我如何推送到这个项目的不同分支。谁能解释一下这是如何工作的,因为我不明白?
git checkout -b branch1
创建并签出分支 branch1
做你的工作,git add
,git commit
等等
git push origin branch1
推送到名为 branch1
最好的快速指南在这里 http://rogerdudler.github.io/git-guide/
您可以在命令中指定分支的名称。 喜欢,
git push origin your_branch
它将本地系统中的 your_branch
分支推送到远程计算机中的 your_branch
。
但是如果你想将一个名为 your_local_branch
的分支推送到一个名为 your_remote_branch
的远程分支,那么你应该输入 -
git push origin your_remote_branch:your_local_branch
.