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

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

  •  
  •   icemanpro · Aug 11, 2014 · 3098 views
    This topic created in 4292 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
        1
    nicai000  
       Aug 11, 2014
    git help ignore为什么不看? 例子里最后一个就是
    yueyoum
        2
    yueyoum  
       Aug 11, 2014
    在 /root/B 目录下 建立一个 .gitignore
    内容如下:

    /*
    !/b2

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