Skip to contentSkip to conversation

rebase: use -f for checkout

PATCH New Orgad Shaneh 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rebase: use -f for checkout

If a file's case is changed on rename (Foo -> foo), rebase fails on Windows because the file already exists.

The change is safe, because if working directory is not clean rebase fails before checking out.

---
 git-rebase.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
git-rebase.sh +1 -1
index b2f1c76..28fdc32 100755
@@ -522,7 +522,7 @@ test "$type" = interactive && run_specific_rebase
 
 # Detach HEAD and reset the tree
 say "$(gettext "First, rewinding head to replay your work on top of it...")"
-git checkout -q "$onto^0" || die "could not detach HEAD"
+git checkout -fq "$onto^0" || die "could not detach HEAD"
 git update-ref ORIG_HEAD $orig_head
 
 # If the $onto is a proper descendant of the tip of the branch, then
Signature · 1 line
1.7.10.4