Si bien pareció no hacer nada, no dio advertencia ni post de error. ¿Algunas ideas?
Comentario de la fuente de 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. */
Experimente para ver qué sucedió si creo un file .git
e bash agregarlo: (en Windows no puedo crear un file .git
cuando ya hay una carpeta .git
. También podría haber creado un .git
en otro lugar en un subdirectory , pero quería probar --git-dir
y --work-tree
que no he usado antes. Después de todo lo que estoy experimentando. Esto también me permite mostrar que puedo agregar la carpeta de metadatos git como se ve a continuación)
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)
Así que sí, .git
– sea un directory o file, es ignorado por git.
Y si hago algo como a continuación:
git --git-dir="c:/test" --work-tree="c:/test" add c:/test
todos los meta files se agregan.
Así que, de nuevo, solo es .git
que se ignora no la carpeta de metadatos git (que se establece a través de --git-dir
) hasta donde puedo ver.
Respuesta corta: nada.
Respuesta larga:
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$