Skip to main content



      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 06:05
Eclipse UserFriend
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 06:07] by Moderator

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


Current Time: Tue May 13 06:58:09 EDT 2025

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

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

Back to the top