[英]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.