最初に git リポジトリを作成するときに、以前に追加してコミットしたのではないでしょうか?
私はこれを再現することができました:
durrantm.../aaa$ git init
Initialized empty Git repository in /home/durrantm/play/aaa/.git/
durrantm.../aaa$ l
total 16
drwxrwxr-x 14 durrantm 4096 Oct 31 22:28 ../
-rw-rw-r-- 1 durrantm 11 Oct 31 22:29 ggg
drwxrwxr-x 3 durrantm 4096 Oct 31 22:29 ./
drwxrwxr-x 7 durrantm 4096 Oct 31 22:29 .git/
durrantm.../aaa$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ggg
nothing added to commit but untracked files present (use "git add" to track)
durrantm.../aaa$ git add .
durrantm.../aaa$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: ggg
#
durrantm.../aaa$ git commit
[master (root-commit) 953c83f] new
1 file changed, 1 insertion(+)
create mode 100644 ggg
durrantm.../aaa$ l
total 16
drwxrwxr-x 14 durrantm 4096 Oct 31 22:28 ../
-rw-rw-r-- 1 durrantm 11 Oct 31 22:29 ggg
drwxrwxr-x 3 durrantm 4096 Oct 31 22:29 ./
drwxrwxr-x 8 durrantm 4096 Oct 31 22:29 .git/
durrantm.../aaa$ git init
Reinitialized existing Git repository in /home/durrantm/play/aaa/.git/
durrantm.../aaa$ l
total 16
drwxrwxr-x 14 durrantm 4096 Oct 31 22:28 ../
-rw-rw-r-- 1 durrantm 11 Oct 31 22:29 ggg
drwxrwxr-x 3 durrantm 4096 Oct 31 22:29 ./
drwxrwxr-x 8 durrantm 4096 Oct 31 22:30 .git/
durrantm.../aaa$ git add .
durrantm.../aaa$ git status
# On branch master
nothing to commit (working directory clean)
durrantm.../aaa$
durrantm.../aaa$ git commit
# On branch master
nothing to commit (working directory clean)
あなたが見ているようnothing to commit
に、 a の後にどのようにあるのかに注意してください。git add .
1 つの「修正」は、git リポジトリを削除してからやり直すことです。これを行うと、通常どおり最終版をコミットできます。たとえば、次のようになります。
durrantm.../aaa$ rm -rf .git/
durrantm.../aaa$ l
total 12
drwxrwxr-x 14 durrantm 4096 Oct 31 22:28 ../
-rw-rw-r-- 1 durrantm 11 Oct 31 22:29 ggg
drwxrwxr-x 2 durrantm 4096 Oct 31 22:34 ./
durrantm.../aaa$ git init
Initialized empty Git repository in /home/durrantm/play/aaa/.git/
durrantm.../aaa$ l
total 16
drwxrwxr-x 14 durrantm 4096 Oct 31 22:28 ../
-rw-rw-r-- 1 durrantm 11 Oct 31 22:29 ggg
drwxrwxr-x 3 durrantm 4096 Oct 31 22:34 ./
drwxrwxr-x 7 durrantm 4096 Oct 31 22:34 .git/
durrantm.../aaa$ git add .
durrantm.../aaa$ git commit
[master (root-commit) 380863a] wewew
1 file changed, 1 insertion(+)
create mode 100644 ggg