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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 5, 2017 at 4:10 PM, brian m. carlson
<sandals@xxxxxxxxxxxxxxxxxxxx> wrote:
> 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.)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]