2011-07-27 14 views

cevap

19

Yorum (Windows üzerinde ı yaratamaz .git klasöründe bir dosya varsa .git bir alt dizinde başka bir yerde .git oluşturmuş olabilirsiniz, ancak --git-dir vedenemek istedim Daha önce kullanmadığım. Sonuçta deney yapıyorum. , Git ile yok sayılır dizin veya dosya olun - Bu aynı zamanda beni aşağıda görüldüğü gibi) git meta klasör ekleyebilir

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) 

Yani evet, .git olduğunu göstermesine olanak tanır. Aşağıda böyle bir şey yaparsanız

Ve:

git --git-dir="c:/test" --work-tree="c:/test" add c:/test 

tüm meta dosyaları ekledi olsun.

Yine, görebildiğim kadarıyla git meta veri klasörünü (--git-dir aracılığıyla ayarladığınız) yok sayılan yalnızca .git.

+0

Kaynakta hangi dosyada/revizyonda bu yorumu buldunuz? –

+0

Nevermind bunu buldu - https://github.com/git/git/blob/fe9122a35213827348c521a16ffd0cf2652c4ac5/dir.c#L1277 –

+0

"Git metadata dir" ile ne demek istiyorsun? Çalışma dizini '--git-dir' ile ayarladığınız dizin değil mi? – HelloGoodbye

16

Kısa cevap: Hiçbir şey.

Uzun cevap:

/* 
* 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. 
*/ 

Deney Bir dosyayı .git oluşturursanız ne oldu görmek ve eklemek için denemek için: Git kaynağından

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$