过去几次,我们遇到了一个问题,即开发人员(明确地或有效地)完成了git merge -s ours他们不应该做的事情,提交已经丢失,而且我们只是在清理工作更加复杂和时间之后才检测到这个问题.耗时.测试没有失败,因为添加测试的提交被静默地还原了他们正在测试的代码.
我想要做的是找到或创建一个总结合并的工具,通过正常合并生成类似下面的输出:
Lines Left(2b3c4d) Right(3c4d5e)
Common with base 970 930
Unique wrt base 20 50
Unique wrt other 15 45
Unique wrt merge 15 45
Common with merge 995 985
Run Code Online (Sandbox Code Playgroud)
但是,如果合并不正确,还原了许多更改,或者git merge -s ours执行了某些更改,则可能会生成如下报告:
Lines Left(2b3c4d) Right(3c4d5e)
Common with base 970 930
Unique wrt base 20 50
Unique wrt other 15 45
Unique wrt merge 15 0 !!
Common with merge 990 935
Warning: 100% of changes from 3c4d5e are missing …Run Code Online (Sandbox Code Playgroud) 我正在做git diff第一次,我看到线旁边有双加号.
++ if ($field_name == $selected) {
++
++ echo "field_type: {$field['type']}\n";
++ echo "field_name: {$field_name}\n";
++
++ foreach ( $node->$field_name as $language => $value ) {
Run Code Online (Sandbox Code Playgroud)
这是什么意思?我用Google搜索了,这个结果并没有真正解释它.我看了一下man,我发现的一个例子似乎也没解释它:
3. It is followed by two-line from-file/to-file header
--- a/file
+++ b/file
Similar to two-line header for traditional unified diff format, /dev/null is used to signal created or deleted files.
Run Code Online (Sandbox Code Playgroud)
这是什么意思?我对文件进行了大于先前版本50%的更改.是否与文件重写有关?这就是我承诺时发生的事情.
我正在尝试迁移到GitFlow工作流程,我想重写存储库的历史记录,以便所有这些都符合新的存储库.
目前它看起来像这样:
Master: A - B - C - D - E - F - - - - - - - - - L
\ /
Release: \ J - K
\ / \
Development: G - H - I M
Run Code Online (Sandbox Code Playgroud)
我希望它看起来像这样:
Master: A - - - - - - - - - - - - - - - - - - - L
\ /
Release: \ J - K
\ / \
Development: B - C - D …Run Code Online (Sandbox Code Playgroud) 我有以下情况:
$ git --version
git version 2.7.3.windows.1
$ git log --graph --oneline
* 83e3254 version 1.1
* 34188af merge of feature into master
|\
| * 784ba31 awesome change
|/
* 6eec273 added file1
* 84d80a5 added version file
Run Code Online (Sandbox Code Playgroud)
要在新目录中重现此问题
rm -rf .git
git init
echo version 1.0 > version.txt
git add version.txt
git commit -m "added version file"
echo file1 > file1
git add file1
git commit -m "added file1"
git checkout -b feature
echo awesome change …Run Code Online (Sandbox Code Playgroud)