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

Re: git checkout --theirs fails

From
Stefan Beller <sbeller@google.com>
Date
Mar 15, 2016, 21:35 UTC
Message-ID
<CAGZ79kbzrpHowSLfCjB6wVfeX_3MUXAjD0rQdcugryWPMrTazQ@mail.gmail.com>
In-Reply-To
<56E845F0.9020609@gmail.com>
On Tue, Mar 15, 2016 at 10:27 AM, Phil Susi <phillsusi@gmail.com> wrote:
Show 9 quoted lines
> I'm doing a rebase and got some conflicts.  I just want to take their
> version of all files, but git checkout --theirs complains:
>
> --ours/--theirs' cannot be used with switching branches
>
> What gives?  I'm not *trying* to switch branches.  I just want to
> resolve the conflict by taking their version.  If I try git checkout
> --theirs ., then it complains that not every single file in the
> directory has a "their" version.  So?  Take the ones that do.

I think for checking out files you'd need to add the file names. In case of a collision between branch name and file name, even add a double dash:

    git checkout --theirs -- file/name
Show 5 quoted lines
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Phil SusiNext: Junio C Hamano
Message 2 of 5 in “git checkout --theirs fails”
  1. Phil SusiMar 15, 2016
  2. Stefan BellerMar 15, 2016
  3. Junio C HamanoMar 15, 2016
  4. Phil SusiMar 16, 2016
  5. Jeff KingMar 16, 2016

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.