博客
关于我
Git过滤文件和文夹
阅读量:459 次
发布时间:2019-03-06

本文共 548 字,大约阅读时间需要 1 分钟。

第一步:添加".gitignore"文件
往项目根目录添加一个文件".gitignore"。这文件和".git"文件夹同级。
但是在windows下无法创建".gitignore"文件名,必须把文件名改成这样".gitignore.",
在文件名最后加一个英文句号就可以了。
第二步:设置过滤条件
bin/ 过滤所有bin文件夹
obj/ 过滤所有obj文件夹
ValorNAV_deploy/ 过滤所有ValorNAV_deploy文件夹
*.dll 过滤所有dll文件,这个最好不要使用dll,因为项目中像lib文件夹我们会放一些dll包。
第三步:把".gitignore"文件提交并且push到服务器
其它的协作成员可以通过pull获取这个文件,其它人的过滤规则保持一致了。
1.如果新建一个空的Git仓库。直接拉取就可以了。
2.如果是一个已经使用了Git仓库,如果需要应用规则,则需要通过命令把相应要过滤的目录
的缓存删除。
git rm --cached <文件名> 删除文件的缓存
git rm --cached -r <目录名> 删除目录下的所有文件的缓存
通过上面的命令把缓存删除后,commit后再push到服务器。
其它的团队成员可以直接pull,过滤功能就能正常使用了。

转载地址:http://sbfbz.baihongyu.com/

你可能感兴趣的文章
nmon_x86_64_centos7工具如何使用
查看>>
NN&DL4.1 Deep L-layer neural network简介
查看>>
NN&DL4.3 Getting your matrix dimensions right
查看>>
NN&DL4.7 Parameters vs Hyperparameters
查看>>
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>