Newbie .gitignore problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am having a problem specifying .gitignore filters properly
I have a directory structure as follows:

ÂÂ Â Â Â Ârepo-root
ÂÂ Â Â Â Â Â Â |
ÂÂ Â Â Â Â Â Â -------------------------------------------------------------------
ÂÂ Â Â Â Â Â Â | Â Â Â Â Â Â Â Â Â Â|
 Â Â Â Â Â |
ÂÂ Â Â Â Â Â Âdir1 Â Â Â Â Â Â Â dir2 Â(symlink)
      Âdir3
ÂÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â|
ÂÂ Â Â Â Â Â Â Â---------------------------------------------------
ÂÂ Â Â Â Â Â Â | Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |
    Âmany directories and files           dir4

My problem is that I want to exclude all files and sub-directories in dir2
except for dir4 from control by Git.
I tried a number of variations on the following .gitignore file in dir2 but
either everything was excluded or everything was included. I tested using
git add -uall -n

The final .gitignore file was
*
*/*
!dir4


How should I go about tackling this. The .gitignore man pages were
unclear to me.

Jonathan Gossage
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj· ŠßžØn‡r¡öë¨è&£ûz¹Þúzf£¢·hšˆ§~†­†Ûÿÿïÿ‘ê_èæ+v‰¨þ)ßø

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]