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

Re: What commands can and can not be used with bare repositories?

From
JFJ. Bruce Fields <bfields@fieldses.org>
Date
Dec 31, 2006, 01:57 UTC
Message-ID
<20061231015728.GB20348@fieldses.org>
In-Reply-To
<E1H0poE-0000qd-Ee@candygram.thunk.org>
On Sat, Dec 30, 2006 at 08:48:22PM -0500, Theodore Ts'o wrote:
Show 11 quoted lines
> What isn't documented is what commands actually can deal with a bare
> repository.  At the moment, it looks like a bare repository can be a
> target of a git pull, push, and merge commands, and it can be a source
> for a git clone, but that seems to be about it.  All other commands,
> such as "git log" blow up with the error message "Not a git repository".
> This to me seems a bit lame, since why isn't a "bare repository" also a
> "git repository"?  All of the information is there for "git log" to
> work.  Commands that require a working directory obviously can't work,
> but there are plenty of git commands for which there's no reason why
> they shouldn't be able to operate on a bare repository.  For example,
> "git repack", "git log", "git fetch", etc.

Yup. Anything that should work actually does; you just need to know to use one of:

	GIT_DIR=. git log
	git --git-dir=. log
	git --bare log
Why git couldn't figure this out for you, I don't know....
--b.
Previous: Theodore Ts'oNext: Shawn Pearce
Message 2 of 6 in “What commands can and can not be used with bare repositories?”
  1. Theodore Ts'oDec 31, 2006
  2. J. Bruce FieldsDec 31, 2006
  3. Shawn PearceDec 31, 2006
  4. Theodore TsoDec 31, 2006
  5. Michael S. TsirkinDec 31, 2006
  6. Junio C HamanoDec 31, 2006

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.