LoginSignup
11
11

More than 5 years have passed since last update.

`git init`直後の`git reset .`

Posted at

通常、

git add .

の反対は

git reset .

で良い。

ただ、それがgit initの直後で、まだ一つもコミットがない状態だと

$ git add .
$ git reset .
fatal: Failed to resolve 'HEAD' as a valid ref.

とHEADがないよと怒られてしまう。

そんな時は、

git rm --cached -r .

とすると解決する。

11
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11