- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我们使用 Github Desktop(以前称为 Github for Windows)作为我们的 Git 客户端。我们经常会遇到以下情况:
开发人员 A 提交了一系列带有可爱解释性消息的更新。开发者 B 一直在同一个分支上工作,然后提交了一条消息。
开发人员 B 的提交和消息显示在 git 日志中,紧随其后,我们从开发人员 B 获得 merge 提交,并带有自动消息“merge branch ...”。 merge 提交包含开发人员 A 的所有更改,但开发人员 A 的可爱消息消失了。这种行为似乎已经发生了一些变化——过去很少发生,现在似乎一直都在发生。
(很难准确地找到关于 Github Desktop 中“同步”按钮功能的最新信息,但我确实找到了 a reference 表明它曾经用于 git pull --rebase
然后更改。这似乎符合这个 merge 提交问题比以前严重得多的事实。)
所以我的问题是:有什么方法可以防止开发者A的提交信息丢失吗?
编辑添加:似乎问题有两个方面:1)我们的开发人员并不总是在提交之前进行 pull ,从而导致 merge 提交。原始提交不会丢失,但不可见。2) Github Desktop 显示日志的方式是显示 merge 提交但不显示原始提交。这是我在 Github Desktop 团队的电子邮件中收到的评论:
Digging into this further, it does look like the commits are being hidden due to the --first-parent flag that we use when showing the history in GitHub Desktop. Currently there isn't a way to change this behavior.
Here's some of the rational behind why we do this that a developer of GitHub Desktop shared:
"GitHub Desktop is optimized for GitHub Flow. In this model, merges almost always represent either (1) a branch getting merged into the default branch via a pull request or (2) a branch being updated from the default branch.
In the first case, it's most useful to see which pull requests have been merged—not the individual commits that make up that pull request. We think pull requests are amazing and very useful for understanding history, so we want to prioritize them.
In the second case, seeing the commits that came in with a merge only obscures the changes on the branch. It's most useful to see the commits that are unique to the branch."
我们最终感觉 Github Desktop 可能不适合我们——我个人已经切换到 GitKraken,我们中的很多人更多地使用命令行。
最佳答案
Git merge 不应该那样。如果您不能确定您的 Git GUI 正在执行哪些命令( merge 、 rebase 、压缩等),我建议您使用命令行执行 git merge
,这样您就可以控制发生的事情。
我倾向于提倡命令行 Git,因为大多数图形化 Git 客户端带来的晦涩和词汇困惑。
关于github桌面 merge 提交 stash 评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36200919/
我如何在一个语句中删除最旧的存储(比如最旧的 5 个存储)而不是像这样做: git stash drop stash@{3} git stash drop stash@{4} git stash dr
我认为它们应该基本相同,但是当我尝试 $ git stash show -p stash@{N} 和 $ git show stash@{N} 后者显示了一些额外的提交信息,但实际差异要短得多。 (前
我一直在 git 的一个分支上工作,然后我藏了一些东西。在分支之间进行一些切换后,我回到了我的初始分支,进行了一些新的更改,将它们存储起来,然后意识到我想回到我第一次存储之前所做的更改。 所以我的问题
我使用 git 管理主目录中的配置文件。这是我的主目录中 .gitignore 文件的简化内容。 * !.bashrc !.bash_aliases !.gitignore 我在我的主目录 .bash
这个问题在这里已经有了答案: How to remove range of git stash? (6 个答案) 关闭 4 年前。 我有以下存储列表(git stash list): stash@{
我正在尝试使用以下方式应用特定的存储: git stash apply stash@{2} 但最终出现这个错误: fatal: ambiguous argument 'stash@': unknown
我想创建一个 git 包,它只包含我的存储中不在存储所基于的点的提交。我想这样做而不是发送每一次提交,因为我知道收件人已经有每一次提交,包括分歧点。 我得到这个: $ git bundle creat
我对我的分支进行了一些更改,然后意识到我忘记了我已经对所述分支进行了一些其他必要的更改。我想要的是一种将我 stash 的更改与当前更改 merge 的方法。 有办法吗? 更多的是为了方便,我最终放弃
不太确定发生了什么,但 git stash 似乎在一个糟糕的地方。 % git stash list stash@{0}: filter-branch: rewrite stash@{1}: filt
在 channel 入口条件中使用 stash:variables 时,我遇到了 Stash 问题。 模板.html {stash:embed name="pages" stash:paginate=
很多时候,在进行实验性更改之前,我需要拍摄当前工作目录的快照作为备份。这就是我所做的。 git stash git stash apply 但是我使用了一些监听磁盘更改的应用程序,它们会导致不需要的行
在我们的办公室中,我们使用没有服务器访问权限的 Stash(最大访问级别是创建分支),因此我们需要限制特定 Git 分支的推送。所以很简单,我们需要做的就是在发布后卡住我们的分支。 目前我们正在做的是
我更改了一些文件和一些新文件 git pull: 说我在几个文件中有冲突 我做到了: git stash git pull git stash pop 我预计会发生冲突,但没有发生。 相反,许多文件现
我有一个 Windows 命令脚本,旨在将 dev 分支 merge 到项目分支中。它首先读取当前分支名称、存储更改、获取并 merge 开发和项目分支,然后切换回原始分支并 pop 存储。 问题是
git stash 的联机帮助页说 pop [--index] [-q|--quiet] [] Remove a single stashed state from the stash list an
请理解场景: 1. 一天前创建了一个新分支,并将我的工作推送到那里。 2.整天忙于sublime,修改现有文件,创建一些新文件。 3. 没有添加或提交,但存储,切换到另一个分支,在那里提交并 pop
谁能解释一下它们之间的区别: git stash 对比: git stash save ? 谢谢! 最佳答案 来自docs : Calling git stash without any argume
首先我输入 git stash show。 然后输入s和tab,显示git stash show stash@{,到此为止一切正常。 但是我输入1和tab后,变成了git stash show sta
在使用 git add -p 对索引添加一些更改后,我发布了一个 git stash 但忘记添加 --keep-index。然后我就傻傻的做了一个git stash pop,我对索引的修改都没有了。有
使用 Xcode,在尝试将代码更新推送到 Github 时,系统提示我“Pull and Stash”。我不小心选择了好吧,现在我的Xcode项目是旧版本(最后一个推送到GitHub)。我怎样才能将其
我是一名优秀的程序员,十分优秀!