2 ms·
Your claim is not correct. $ git init Initialized empty Git repository in /home/kaz/junk/gittest/.git/ $ echo content > file $ git add file $ git com
by kazinator 4y ago
Your claim is not correct.
$ git init
Initialized empty Git repository in /home/kaz/junk/gittest/.git/
$ echo content > file
$ git add file
$ git commit -m first-commit-not-second
[master (root-commit) 2bf5805] first-commit-not-second
1 file changed, 1 insertion(+)
create mode 100644 file
OK, now let's reset the file to the previous commit, to stage a change which removes it from that commit:
$ git reset HEAD^ -- file
fatal: Failed to resolve 'HEAD^' as a valid tree.
There is no commit made by git init. The above reset would work if there was a commit before HEAD.
Git apologists will say anything to defend its traps and pitfalls.