git - Git说master是最新的,但不是
问题描述
我有一个 repo,其中我已将更改推送到 master 分支,然后我创建了其他分支(4taFase)并开始在那里进行一些推送。完成工作后,我想推送到 MASTER,所以我签出到 master,但它说它是最新的,但显然不是(我做了 git add、commit 和 push)。我已经尝试过 git pull、git merge 和我在互联网上阅读的所有内容。请帮助和感谢。
解决方案
从您的描述中,我看到您目前有 2 个分支:
- 掌握
- 4taFase
4taFase 基于 master 但有几个 master 没有的提交。如果是这样,您有以下选择:
从4taFase合并到 master。您将在 4taFase 中完成的所有工作都复制到 master 中,但只需一次提交。
git checkout master git merge 4taFase
做cherry-pick以将特定的提交从4taFase转移到master
git checkout master git cherry-pick <commit-hash from 4taFase>
推荐阅读
- node.js - 如何通过自定义 Windows Powershell 参数修复赛普拉斯运行的警告?
- sql - SQL REPLACE 可以作为字符串和子字符串的“查找和替换”功能吗?
- f# - 如何访问列表中元组的第一个元素?
- angular - 使用 Angular DI 获取注入点/注入目标
- swift - 在用户位置的地图上添加图钉
- javascript - FileReader 结果将我带到地址栏中带有“about:blank#blocked”的空白页面
- c++ - 如何在 C++ 中调用析构函数
- r - 查找两个矩阵之间最近的一组坐标
- php - PHP - 比较两个数组,如果有重复,则删除所有匹配项
- django - 如何在 django 2.2 的一个基于类的视图中收集所有模型中的所有对象