git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] rebase: use -f for checkout

From
Orgad Shaneh <orgads@gmail.com>
Date
Apr 10, 2013, 18:11 UTC
Message-ID
<1365617484-5181-1-git-send-email-orgads@gmail.com>

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(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index b2f1c76..28fdc32 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -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
-- 
1.7.10.4
Message 1 of 1 in “rebase: use -f for checkout”
  1. rebase: use -f for checkoutOrgad Shaneh, Apr 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.