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

git rebase does not understand --work-tree

From
Alexander Gladysh <agladysh@gmail.com>
Date
Jul 14, 2010, 09:04 UTC
Message-ID
<AANLkTimnk6tflv9ZZCydlX1la35GjsRfvjgTk44uDFbO@mail.gmail.com>
Hi, list!

$ git --version git version 1.7.1.1

I often use --work-tree and --git-dir to avoid doing cd in my scripts.

However, I've found that git rebase does not understand --work-tree option (see test below). Is this fixable?

Thanks, Alexander.

mkdir tmp cd tmp git init echo "test">file.txt git add . git commit -m "initial commit"

git checkout -b other-branch echo "test2">otherfile.txt git add . git commit -m "second commit"

cd .. git --git-dir=tmp/.git --work-tree=tmp rebase other-branch

fatal: /usr/local/libexec/git-core/git-rebase cannot be used without a working tree.

Next: Michael J Gruber
Message 1 of 3 in “git rebase does not understand --work-tree”
  1. Alexander GladyshJul 14, 2010
  2. Michael J GruberJul 14, 2010
  3. am/pull/rebase/stash: cd_to_toplevel before require_work_treeMichael J Gruber, Jul 14, 2010

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.