何もしていないように見えましたが、警告やエラー メッセージは表示されませんでした。何か案は?
5786 次
2 に答える
23
Git ソースからのコメント:
/*
* Read a directory tree. We currently ignore anything but
* directories, regular files and symlinks. That's because git
* doesn't handle them at all yet. Maybe that will change some
* day.
*
* Also, we ignore the name ".git" (even if it is not a directory).
* That likely will not change.
*/
.git
ファイルを作成して追加しようとするとどうなるか実験してみてください: (Windows では、既にフォルダーがある場合、ファイルを作成できませ.git
ん.git
。私は以前に使用したことがありません. 結局、私は実験しています. これにより、以下に示すように、git メタデータ フォルダーを追加できることを示すこともできます).git
--git-dir
--work-tree
git --git-dir="c:/test" init
touch blah
git --git-dir="c:/test" --work-tree="." add .
git --git-dir="c:/test" --work-tree="." status ( shows blah added)
touch .git
git --git-dir="c:/test" --work-tree="." add .git ( no output as usual)
git --git-dir="c:/test" --work-tree="." status ( only blah shown)
ええ、.git
ディレクトリであろうとファイルであろうと、gitは無視します。
そして、私が以下のようなことをした場合:
git --git-dir="c:/test" --work-tree="c:/test" add c:/test
すべてのメタ ファイルが追加されます。
繰り返しますが、私が見る限り、.git
無視されるのは git メタデータ フォルダー (で設定したもの) だけではありません。--git-dir
于 2011-07-27T06:14:24.130 に答える
18
簡単な答え: 何もありません。
長い答え:
laptop:Projects ctcherry$ mkdir test
laptop:Projects ctcherry$ cd test
laptop:test ctcherry$ git init .
Initialized empty Git repository in /Users/ctcherry/Projects/test/.git/
laptop:test ctcherry$ git add .git
laptop:test ctcherry$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)
laptop:test ctcherry$
于 2011-07-27T05:33:44.337 に答える