git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git / Subversion Interoperability

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 24, 2007, 20:13 UTC
Message-ID
<Pine.LNX.4.64.0703241258560.6730@woody.linux-foundation.org>
In-Reply-To
<20070324185517.GA10876@diana.vm.bytemark.co.uk>
On Sat, 24 Mar 2007, Karl Hasselström wrote:
Show 6 quoted lines
>
> There is a slight problem with directly converting between svn:ignore
> and .gitignore, though: the semantics are only almost the same.
> Specifically, git's ignore patters are recursive (applies to
> subdirectories) while subversion's are not. But it's not a big
> problem.

You should be able to use an "absolute" path-name to ignore something in .gitignore, in which case it is not used recursively.

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
Previous: Karl HasselströmNext: Junio C Hamano
Message 15 of 25 in “Git / Subversion Interoperability”
  1. Bruno Cesar RibasMar 22, 2007
  2. Shawn O. PearceMar 23, 2007
  3. Julian PhillipsMar 23, 2007
  4. Shawn O. PearceMar 23, 2007
  5. Julian PhillipsMar 23, 2007
  6. Karl HasselströmMar 23, 2007
  7. Bruno Cesar RibasMar 23, 2007
  8. Karl HasselströmMar 23, 2007
  9. Julian PhillipsMar 23, 2007
  10. Bruno Cesar RibasMar 23, 2007
  11. David LangMar 23, 2007
  12. Daniel BarkalowMar 23, 2007
  13. Shawn O. PearceMar 24, 2007
  14. Karl HasselströmMar 24, 2007
  15. Linus TorvaldsMar 24, 2007
  16. Junio C HamanoMar 24, 2007
  17. Sam VilainMar 26, 2007
  18. Christian WieseMar 23, 2007
  19. Steven GrimmMar 23, 2007
  20. Shawn O. PearceMar 24, 2007
  21. Sam VilainMar 26, 2007
  22. Jakub NarebskiMar 23, 2007
  23. Shawn O. PearceMar 24, 2007
  24. Eric WongMar 24, 2007
  25. Eric WongMar 24, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.