git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
Cu635
V2EX  ›  git

各位, git 有办法按照文件类型 ignore 么?

  •  
  •   Cu635 · Oct 14, 2015 · 3784 views
    This topic created in 3869 days ago, the information mentioned may be changed or developed.
    用 git 的时候需要配置 gitignore ,按照文件扩展名 ignore 这是没问题的。

    有没有办法让 git 按照文件类型来 ignore ?

    类似于“先用 file 命令确定文件类型,然后再用文件类型作为参数去 ignore ”,当然具体的实现不一定用 file 命令了。
    5 replies    2015-10-15 11:14:54 +08:00
    FrankFang128
        2
    FrankFang128  
       Oct 14, 2015 via Android
    你不能先统一一下文件扩展名么
    Robling
        3
    Robling  
       Oct 14, 2015 via Android
    用 git 的钩子脚本动态生成 gitignore
    xiuc001
        4
    xiuc001  
       Oct 15, 2015
    可以用文件名 ignore ,但要注意的是如果你的文件已经在版本库了,即使你配置了 ignore 文件也是不生效的
    Cu635
        5
    Cu635  
    OP
       Oct 15, 2015
    @Robling 多谢。看样子这是最为接近的办法了。

    不过这样的话每次有新文件 unversioned 的话都要扫描了?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2505 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 15:39 · PVG 23:39 · LAX 08:39 · JFK 11:39
    ♥ Do have faith in what you're doing.