以什么顺序执行git命令以将变更从暂存中拉出,与功能合并并推送到远程?

问题描述 投票:0回答:1

我有一个名为feature的功能分支和一个名为staging.的登台分支,如何在将staging推送到Github之前,获取feature的最新更新并将其合并到feature中?

git github staging
1个回答
1
投票

我会运行类似的东西:

git fetch --all       (update your git's knowledge of remote stuff)
git checkout feature  ('tags' your folder as code belonging to feature branch and downloading the code)
git pull origin staging  (downloads staging code and but keeps it as code belonging to feature branch)
git add .            (marks all code changes for commit)
git commit -m'my awesome code changes' ( commits)
git push origin feature  (Pushing all your changes to feature branch)

嗯,拉动之后,您很可能需要解决所有冲突。但这超出了范围:)

但是在运行来自互联网的某人的任何命令之前...进行保留副本:)

© www.soinside.com 2019 - 2024. All rights reserved.