Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Determining if a file is ignored via .gitignore
Determining if a file is ignored via .gitignore [message #1837415] Fri, 29 January 2021 15:24 Go to next message
Sam Brannen is currently offline Sam BrannenFriend
Messages: 1
Registered: January 2021
Junior Member
Is it possible to determine if a given file would be ignored by .gitignore using the JGit Java APIs?
Re: Determining if a file is ignored via .gitignore [message #1837433 is a reply to message #1837415] Fri, 29 January 2021 19:58 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1177
Registered: July 2009
Senior Member
Sure, use WorkingTreeIterator.isEntryIgnored().
Find a complete example in EGit's RepositoryUtil [1].

[1] https://git.eclipse.org/r/plugins/gitiles/egit/egit/+/refs/heads/master/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java#743
Previous Topic:Single Branch Fetch
Next Topic:What is the difference in the INDEX file format compared to the Git bash?
Goto Forum:
  


Current Time: Sat Jun 19 23:13:23 GMT 2021

Powered by FUDForum. Page generated in 0.01634 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top