Replaying Git Merge Conflict: DD
I'm working on a test script and is trying to reproduce a git merge DD conflict when displayed via git status --short. "I've seen this type of conflict in the past.
- DD (unmarked, both deleted)
I continue to walk without conflict with everything I try.
What steps do you need to follow to create a DD conflict? What does the "DD" conflict mean?
I've seen this: Git: How to create different unrelated states? But the steps listed here no longer lead to conflicts in later versions of Git.
0
source to share
1 answer
Found link to https://github.com/git/git/blob/master/t/t7060-wtstatus.sh . It's hard to read, but it contains test code for all types of git conflicts.
To create DD:
git init
echo test > main.txt
git checkout -b conflict && git add main.txt && git commit -m main.txt &&
git branch conflict_second && git mv main.txt sub_master.txt
git commit -m "main.txt renamed in sub_master.txt" && git checkout conflict_second
git mv main.txt sub_second.txt
git commit -m "main.txt renamed in sub_second.txt"
git reset --hard conflict_second
git merge conflict
Results in:
=->git status
On branch conflict_second
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)
both deleted: main.txt
added by them: sub_master.txt
added by us: sub_second.txt
or
=->git status -s
DD main.txt
UA sub_master.txt
AU sub_second.txt
+1
source to share