git - 以什么顺序执行 git 命令以从暂存中提取更改、与功能合并并推送到远程?
问题描述
我有一个名为的功能分支feature
和一个名为的暂存分支,staging.
如何在推送到 Github之前获取最新更新staging
并将其合并到?feature
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)
好吧,拉后你很可能需要解决所有冲突。但这超出了范围:)
但是在运行来自互联网的人的任何命令之前......做一个保留副本:)
推荐阅读
- mysql - 递归选择表
- python - 如何与 Tkinter 的 while 循环并行运行代码?
- c - C中的'和'有什么区别?
- python - 调用 Python 脚本时如何消除 IIS 上的 401 错误?
- python - 如何从 CSV 文件中提取数据并导入 Python 中的字典?
- python - Unable to read some files found using os.walk
- r - 如何在R中将一个类别从列中获取到另一列?
- c# - Janusys scheduler problem, when adding a bunch of appointments
- swift - 当我通过点击创建 UIView 时,如何不让它们重叠?
- java - Gson fromJson returns null after Proguard