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

Re: What does this output of git supposed to mean ?

From
Stefan Beller <sbeller@google.com>
Date
Jun 5, 2017, 23:18 UTC
Message-ID
<CAGZ79kYp6GepJxZjaXhosX=vCh0vwa57+zFHK2gHFociiyTnDg@mail.gmail.com>
In-Reply-To
<20170605231058.pgb4fgfb4z45bzmk@genre.crustytoothpaste.net>

On Mon, Jun 5, 2017 at 4:10 PM, brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 19 quoted lines
> On Mon, Jun 05, 2017 at 07:34:12PM +0530, Kaartic Sivaraam wrote:
>> Hello all,
>>
>> I noticed a weird output by git when trying to run 'git status' on a
>> newly initialized git repository. It prints the following,
>>
>> > On branch master
>> >
>> > Initial commit
>> >
>> > nothing to commit (create/copy files and use "git add" to track)
>>
>>
>> What's that "Initial commit" supposed to mean?
>
> It just means that it will be the first commit in the repository.  It's
> a helpful reminder that some operations (such as git log) won't work as
> expected.  In addition, many people want to commit certain files (such
> as .gitignore) in their initial commit, and this may jog their memory.
Tangent:
For any personal project (or git repository that I start)
I find myself doing one of the following:
1) I think about implications of the git history. And from what I understand
  there are a couple of issues with the very first commit (e.g.
  interactive rebase needs special flags to start from the 0-th commit)
  In this case I run git commit --allow-empty -m "initial commit"
  first and then proceed doing whatever
2. I do not think about history, so the first commit is a
  git commit -a -m "I made a shiny thing", ignoring any advice
  git gave me...

On the subject: maybe we want to rename initial commit to root commit? (evil-me also thinks we could name it "parent-less commit", to reinforce what the lovely git man page generator tries to point at.)

Previous: brian m. carlsonNext: Junio C Hamano
Message 3 of 17 in “What does this output of git supposed to mean ?”
  1. Kaartic SivaraamJun 5, 2017
  2. brian m. carlsonJun 5, 2017
  3. Stefan BellerJun 5, 2017
  4. Junio C HamanoJun 6, 2017
  5. brian m. carlsonJun 6, 2017
  6. Samuel LijinJun 6, 2017
  7. Junio C HamanoJun 6, 2017
  8. DavidJun 6, 2017
  9. Philip OakleyJun 6, 2017
  10. SZEDER GáborJun 6, 2017
  11. Jeff KingJun 6, 2017
  12. Jeff KingJun 6, 2017
  13. Junio C HamanoJun 6, 2017
  14. Kaartic SivaraamJun 6, 2017
  15. Philip OakleyJun 6, 2017
  16. Kaartic SivaraamJun 7, 2017
  17. Philip OakleyJun 7, 2017

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.