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

增加已 ignore 目录下某目录的跟踪,gitignore 文件内应该怎样写?

  •  
  •   icemanpro · Aug 11, 2014 · 3481 views
    This topic created in 4473 days ago, the information mentioned may be changed or developed.
    /Root
    |__A
    |__B
    |__b1
    |__b2
    |__....
    |__bn

    想只跟踪/root/B/b2这个目录, /root/B内其它文件及目录都不跟踪,gitignore应该如何写?

    现gitignore内容如下
    /Root/B

    !/Root/B/b2

    以上写法,B目录已ignore,但b2目录也ignore.
    2 replies  •  2014-08-11 14:06:45 +08:00
    nicai000
    nicai000
    Aug 11, 2014
    1
    git help ignore为什么不看? 例子里最后一个就是
    yueyoum
    yueyoum
    Aug 11, 2014
    2
    在 /root/B 目录下 建立一个 .gitignore
    内容如下:

    /*
    !/b2

    然后 git add /root/B
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3378 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 10:13 · PVG 18:13 · LAX 02:13 · JFK 05:13
    ♥ Do have faith in what you're doing.