以什么顺序执行git命令来从暂存、与功能合并以及推送到远程?
我有一个名为以什么顺序执行git命令来从暂存、与功能合并以及推送到远程?,git,github,staging,Git,Github,Staging,我有一个名为feature的功能分支和一个名为staging的staging分支。在将feature推到Github之前,如何获取staging的最新更新并将其合并到feature git fetch --all (update your git's knowledge of remote stuff) git checkout feature ('tags' your folder as code belonging to feature branch and downloadi
feature
的功能分支和一个名为staging的staging分支。
在将feature
推到Github之前,如何获取staging
的最新更新并将其合并到feature
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)
嗯,在拉完之后,你很可能需要解决所有的冲突。但这超出了范围:)
但在运行来自internet的任何命令之前,请执行保留副本:)顺序与您在文本中所写的顺序完全相同:先合并,然后推送。您尝试这样做时有什么特别的问题吗?@mkrieger1之前,我进入了staging,然后在
功能
分支上执行了git-rebase staging
。在解决了冲突后,不知何故,当我提出拉取请求时,其他人的提交显示为我的个人更改。感谢您的回答!这会在哪里将暂存代码合并到我的功能分支中?好吧,您可以签出“功能”代码。因此,您的文件夹在这一点上有它的所有代码和它的'标签'作为'功能的代码。而“拉”则会下载所有暂存代码,但会将文件夹“标记”为“功能代码”