git忽略异常 [英] git ignore exception

查看:73
本文介绍了git忽略异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个让git忽略 *。dll 文件的gitignore文件,这实际上是我想要的行为。然而,如果我想要一个异常(即能够提交 foo.dll ),我该怎么做到这一点?

I have a gitignore file that makes git ignore *.dll files, and that is actually the behavior I want. However, if I want an exception ( i.e. to be able to commit foo.dll), how can I achieve this?

推荐答案

使用:

*.dll    #Exclude all dlls
!foo.dll #Except for foo.dll

From
$ b

From gitignore:


一个可选的前缀!否定了这种模式;任何先前模式排除的匹配文件将再次包含在内。如果否定模式匹配,则会覆盖较低优先模式的源。

An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources.

这篇关于git忽略异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆