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

Re: [PATCH] checkout without arguments does not make sense

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jul 21, 2008, 21:44 UTC
Message-ID
<20080721214459.GJ32057@genesis.frugalware.org>
In-Reply-To
<32541b130807211436h77bf5985xa61ed7b4941c47dc@mail.gmail.com>
On Mon, Jul 21, 2008 at 05:36:59PM -0400, Avery Pennarun <apenwarr@gmail.com> wrote:
> Eek, are we using "checkout" to get status information now?  If that
> goes wrong, you could be blowing away your locally modified data by
> accident.
Hm, let's say I have uncommitted changes to Makefile, then I'll get:

$ git checkout M Makefile Your branch is ahead of the tracked remote branch 'junio/next' by 1 commit.

But it will not drop my local changes.
> I think "git status" reports this information in recent versions, doesn't it?

Right. But that shows other infos as well, for example the untracked files, etc. So there are cases when git checkout is just better.

However, you are right about it may not be the best habit from my side to use git checkout to get that info. ;-)

Previous: Avery PennarunNext: Johannes Schindelin
Message 5 of 6 in “checkout without arguments does not make sense”
  1. checkout without arguments does not make senseJohannes Sixt, Jul 21, 2008
  2. Miklos VajnaJul 21, 2008
  3. Johannes SixtJul 21, 2008
  4. Avery PennarunJul 21, 2008
  5. Miklos VajnaJul 21, 2008
  6. Johannes SchindelinJul 22, 2008

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.