[英]Would .gitignore items in the remote repository be copied in the local project repository by git clone?
說,如果我在存儲庫ssh://user@remotehost.com:port / home / user / public_html /中建立了git repo,
並且我想將其克隆到本地項目的目錄中,是否將克隆到我的public_html/.git
存儲庫中的遠程主機.gitignore
的附加項?
local$ git clone ssh://user@remotehost.com:port/home/user/public_html/
.gitignore
文件的唯一目的是確保未跟蹤的文件保持未跟蹤。 跟蹤文件的那一刻,例如您故意
git add --force path/to/ignored-file
那一刻.gitignore
文件失去了對該文件的控制權。 因此,如果遠程存儲庫包含.gitignore
文件中列出的文件,則該文件仍將保留在遠程存儲庫以及克隆中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.