-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[testcase notes] #26: git merge
options
#64
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To test
git merge
configuration parametersgit merge
categorization --> #75References
git merge
- git documentationMerge process
(Took from git merge documentation)
When it is not obvious how to reconcile the changes, the following happens:
HEAD
pointer stays the same.MERGE_HEAD
ref is set to point to the other branch head.HEAD
, and stage 3 fromMERGE_HEAD
(you can inspect the stages withgit ls-files -u
). The working tree files contain the result of the "merge" program; i.e. 3-way merge results with familiar conflict markers<<<
===
>>>
.HEAD
Synopsis
--commit
&--no-commit
--no-commit
With
--no-commit
perform the merge but pretend the merge failed and do not autocommit, to give the user a chance to inspect and further tweak the merge result before committing--squash
&--no-squash
--squash
Produce the working tree and index state as if a real merge happened (except for the merge information), but do not actually make a commit, move the
HEAD
, or record$GIT_DIR/MERGE_HEAD
(to cause the next git commit command to create a merge commit). This allows you to create a single commit on top of the current branch whose effect is the same as merging another branch (or more in case of an octopus).--no-squash
With
--no-squash
perform the merge and commit the result. This option can be used to override--squash
.--ff
&--no-ff
&--ff-only
--ff
When the merge resolves as a fast-forward, only update the branch pointer, without creating a merge commit. This is the default behavior.
--no-ff
Create a merge commit even when the merge resolves as a fast-forward. This is the default behaviour when merging an annotated (and possibly signed) tag.
--ff-only
Refuse to merge and exit with a non-zero status unless the current
HEAD
is already up to date or the merge can be resolved as a fast-forward.Tools to use when resolving conflicts
(Took from git merge documentation)
git mergetool
Use a mergetool.
git merge tool
to launch a graphical mergetool which will work you through the merge.git diff
Look at the diffs.
git diff
will show a three-way diff, highlighting changes from both theHEAD
andMERGE_HEAD
versions.git log merge -p <path>
Look at the diffs from each branch.
git log --merge -p <path>
will show diffs first for theHEAD
version and then theMERGE_HEAD
version.git show :n:filename
Look at the originals.
git show :1:filename
shows the common ancestor,git show :2:filename
shows theHEAD
version, andgit show :3:filename
shows theMERGE_HEAD
version.Merge strategies
(reference: git merge documentation)
resolve
recursive
ours
theirs
patience
diff-algorithm=[patience|minimal|histogram|myers]
ignore-space-change
ignore-all-space
ignore-space-at-eol
renormalize
no-renormalize
no-renames
find-names[=<n>]
rename-threshold=<n>
subtree[=<path>]
octopus
ours
subtree
The text was updated successfully, but these errors were encountered: