git_merge to merge a branch into the current head. Based on how the branches
have diverged, the function will select a fast-forward or merge-commit strategy.
git_merge(ref, commit = TRUE, squash = FALSE, repo = ".") git_merge_stage_only(ref, squash = FALSE, repo = ".") git_merge_find_base(ref, target = "HEAD", repo = ".") git_merge_analysis(ref, repo = ".") git_merge_abort(repo = ".")
branch or commit that you want to merge
automatically create a merge commit if the merge succeeds without
conflicts. Set this to
omits the second parent from the commit, which make the merge a regular single-parent commit.
the branch where you want to merge into. Defaults to current
git_merge automatically commits the merge commit upon success.
However if the merge fails with merge-conflicts, or if
commit is set to
FALSE, the changes are staged and the repository is put in merging state,
and you have to manually run
git_merge_abort to proceed.
Other functions are more low-level tools that are used by
git_merge_find_base looks up the commit where two branches have diverged
(i.e. the youngest common ancestor). The
git_merge_analysis is used to
test if a merge can simply be fast forwarded or not.
git_merge_stage_only function applies and stages changes, without
committing or fast-forwarding.