Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » How to avoid reading the global user git config
How to avoid reading the global user git config [message #1855720] Fri, 28 October 2022 10:05
Kirill Likhodedov is currently offline Kirill LikhodedovFriend
Messages: 3
Registered: June 2022
Junior Member
Is it possible to instruct JGit not to read the global gitconfig from the user home (~/.gitconfig), and the system gitconfig either?

It is possible to customize the SystemReader for that. But in my application the JGit library is used by different clients, and other clients need the standard JGit behavior accessing the ~/.gitconfig. Since the SystemReader is a singleton, it is not possible to customize it only for a part of the application.

I'm thinking of subclassing the FileRepository to override the getConfig() method, but I don't like this solution since it will require manual creation of the FileRepository object instead of using the RepositoryBuilder, and also can break with a future update of JGit.

Are there any other ways to do it? Thanks a lot.

[Updated on: Fri, 28 October 2022 10:07]

Report message to a moderator

Previous Topic:Jgit pgm cli
Next Topic:EGit - Windows Share as Remote Repository Over SSH
Goto Forum:
  


Current Time: Thu Apr 25 05:02:32 GMT 2024

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

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

Back to the top