tags:

views:

46

answers:

1

I am newbie with git. It tried this tutorial, but after the command, i get this error:

[root@WL-0022150E7BD4 alma]$ git diff --cached
fatal: No HEAD commit to compare with (yet)

I created two file in the current directory. I dont understand, it is the first step in the tutorial.

+1  A: 

It's not the first step in the tutorial: you should have done git init, git add . (with at least some files in the working directory), git commit and another git add before you do a git diff --cached.

Provided that there wasn't an error in the commit step, git diff --cached should not give you this error.

Charles Bailey
Ok, not the first step, but it is in the first steps. Anyway i solved my problem. git commit command hadn't any affect cause, first you will use git commit -m 'Initial commit' type of command. With the -m parameter.
Kukoda János
Unfortunately, in this basic tutorial they forget this to emphasize.
Kukoda János
You don't have to use `-m`, without it you should be able to use a text editor to write a commit message.
Charles Bailey