在git中特定的忽略文件 [英] Repo specific ignore files in git

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

问题描述

是否有可能回购特定的.gitignore文件?例如:

[原产地]
.gitignore:



  • foo1 。*

  • foo2。*



[another] .gitignore:




  • bar1。*

  • bar2。*



这个背后的目的是我们将git部署到托管的云服务上,我们希望将dev文件保存在版本控制中,但不会将它们推送到回购站。

$ b $是的,你可以在每个存储库中的 .git / info / exclude 中放置每个存储库忽略模式。 。(注意,这只影响每个存储库中被忽略的内容,它不会影响您在源代码管理和推送中主动放置的文件。我不是完全清楚你想要的用例。)


Is it possible to have repo specific .gitignore files? Eg:

[origin] .gitignore:

  • foo1.*
  • foo2.*

[another] .gitignore:

  • bar1.*
  • bar2.*

The purpose behind this is that we deploy using git on to a managed cloud service and we'd like to keep dev files in version control but not push them to a repo.

解决方案

Yes, you can put per repository ignore patterns in .git/info/exclude in each repository.

(Note, this only affects what is ignored in each repository, it won't affect files that you actively place under source control and the push. I'm not completely clear on your desired use case.)

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

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