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

[Bug?] Problem with git show when not in repository's root dir

From
Nazri Ramliy <ayiehere@gmail.com>
Date
Feb 9, 2009, 23:23 UTC
Message-ID
<544dda350902091523i2989318bq3ee0f120ca77b7dd@mail.gmail.com>
Repository structure:

a/ - repository's root dir (.git is in here) a/a.txt a/b/b.txt

After merging with conflict:

% git status a.txt: needs merge # On branch b1 # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # unmerged: ../a.txt # no changes added to commit (use "git add" and/or "git commit -a")

% git show :1:a.txt Hello Good World Bye

% git show :2:a.txt Hello This is where it conflicts Bye

% cd b

% git status a.txt: needs merge # On branch b1 # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # unmerged: ../a.txt # no changes added to commit (use "git add" and/or "git commit -a")

% git show :2:../a.txt # here's the problem fatal: ambiguous argument ':2:../a.txt': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

Should "git show" be taught with the "--ours" and "--theirs" options? git checkout knows them, but git show doesn't. At least to me, "--ours" and "--theirs" are easier to understand than :1: and :2:

nazri.
Message 1 of 1 in “[Bug?] Problem with git show when not in repository's root dir”
  1. Nazri RamliyFeb 9, 2009

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.