从特定的分支拉到特定的分支 [英] git pulling FROM a specific branch TO a specific branch
问题描述
我们计划让多个编码器以如下方式在登台服务器上工作: p>
- 编码器在其本地回购库上的单独分支上工作;
- 编码器将更改推送到github;然后
- 编码器将更新从github提取到服务器repo
因此,在实践中,第3步,编码人员将在暂存存储库中运行以下代码:
git checkout coderA-updates
git pull origin coderA-updates
git checkout master
有没有办法更新一个特定的分支而不必首先 git checkout
它?
TLDR:
你如何做一些像 git pull origin remoteBranch localBranch
切换活动分支?
感谢:)
使用 fetch
:
git fetch origin remoteBranch:localBranch
这仅适用于默认情况下的快速更改(请参阅 docs )。
We are using a github repo as our "central repository".
We are planning to have multiple coders working on the staging server in the following manner:
- Coders work on a separate branch on their local repo;
- Coders push changes to github; and then
- Coders pull updates from github to server repo
So, in practice, on Step 3, coders will run the following on the staging repo:
git checkout coderA-updates
git pull origin coderA-updates
git checkout master
Is there a way to update a specific branch without having to git checkout
it first?
TLDR:
How do you do something like git pull origin remoteBranch localBranch
without having to switch active branches?
Thanks :)
Use a plain fetch
:
git fetch origin remoteBranch:localBranch
This will only work for fast-forward changes by default (see the docs).
这篇关于从特定的分支拉到特定的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!