[英]Not version control a subdirectory?
I have a dir project
containing directories .git
, src
, data
and other subdirs. 我有一个包含目录.git
, src
, data
和其他子目录的dir project
。 How can I stop sharing data
(ie stop including data
in the repository, and letting it appearing in other git repositories), while still sharing src
and other subdirs? 在仍然共享src
和其他子目录的同时,如何停止共享data
(即停止在存储库中包含data
,并使其出现在其他git存储库中)?
Shall I move data
out of project
? 我应该将data
移出project
吗?
Thanks. 谢谢。
To stop tracking data
dir: 要停止跟踪data
目录:
git rm -r --cached data
UPDATE 更新
As @MykolaGurov mentioned, you may also add data
dir to .gitignore
. 正如@MykolaGurov所提到的,您还可以将data
目录添加到.gitignore
。
echo 'data' >> .gitignore
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.