私はこれが単純であることを望んでおり、git を奇妙に構成しただけですが、これは予期された動作ではないと思います。
簡単な git リポジトリを作成しました
> mkdir tmp
> cd tmp
> touch this
> mkdir that
> touch that/what
> git init
Initialized empty Git repository in /home/.../tmp/.git/
> git add this that
> git commit -a -m "initial commit"
[master (root-commit) 679f2ae] initial commit
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 that/what
create mode 100644 this
次に、新しく作成した git リポジトリでステータスを確認します
> git status
# On branch master
nothing to commit, working directory clean
予想どおり、何もコミットする必要はありません。ただし、ディレクトリ「that」にcdしてステータスを実行すると、次のようになります。
> cd that
> git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: that/what
# deleted: this
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# what
no changes added to commit (use "git add" and/or "git commit -a")
私の質問は、現在の作業ディレクトリがレポのルートではないのに、なぜ git はすべてが削除/追跡されていないと考えるのですか? 私はそれが期待された行動だとは思わなかった。