You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
branch create --below detaches to the commit right before the current branch to insert the new commit at.
Git will refuse this operation if there are uncommitted changes to files that are also modified in the commits we're going under.
E.g., if we had:
This will fail because the uncommitted changes to foo.txt will be lost from the current context.
This may be solvable with the --merge flag of git-checkout:
-m, --merge
When switching branches, if you have local modifications to one or more files that are
different between the current branch and the branch to which you are switching, the command
refuses to switch branches in order to preserve your modifications in context. However, with
this option, a three-way merge between the current branch, your working tree contents, and
the new branch is done, and you will be on the new branch.
When a merge conflict happens, the index entries for conflicting paths are left unmerged, and
you need to resolve the conflicts and mark the resolved paths with git add (or git rm if the
merge should result in deletion of the path).
When checking out paths from the index, this option lets you recreate the conflicted merge in
the specified paths. This option cannot be used when checking out paths from a tree-ish.
When switching branches with --merge, staged changes may be lost.
We would need a way to handle conflicts in that process, though; perhaps just reject any changes that would conflict.
The text was updated successfully, but these errors were encountered:
branch create --below
detaches to the commit right before the current branch to insert the new commit at.Git will refuse this operation if there are uncommitted changes to files that are also modified in the commits we're going under.
E.g., if we had:
This will fail because the uncommitted changes to foo.txt will be lost from the current context.
This may be solvable with the
--merge
flag of git-checkout:We would need a way to handle conflicts in that process, though; perhaps just reject any changes that would conflict.
The text was updated successfully, but these errors were encountered: