Re: Git / Subversion Interoperability

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

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> So if your .gitignore looks like
>
> 	*.o
>
> it means that it recursively ignores all *.o files starting at that level.
>
> HOWEVER, if you write it as
>
> 	/*.o
>
> it means that it ignores *.o files only *within* that level (so it's 
> "absolute" wrt the particular .gitignore file, not globally).
>
> So you can have both behaviours.
>
> [ I think the exact behaviour is: if there is a '/' anywhere in the name, 
>   it's not a recursive match and has to match the file exactly, but 
>   somebody like Junio should probably back me up on that ]
> 		Linus

Yes, that is what dir.c::excluded_1() says.  If it does not have
'/' then fnmatch the basename, otherwise fnmatch with
FNM_PATHNAME.  So I think if you write

               /obj/*.o

you can ignore *.o files in obj/ directory (but won't ignore a/obj/b.o).

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]