Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit PUSH only Single File(JGIT commit and PUSH only single file to given folder location in remote repository)
JGit PUSH only Single File [message #1787560] Tue, 29 May 2018 05:21 Go to next message
Pravin Rajput is currently offline Pravin RajputFriend
Messages: 1
Registered: May 2018
Junior Member
I need to write one Java program which allow me to PUSH/Check-in one single file to the given GIT repository.
For this I am using JGIT libraries.
But by using JGIT I found one issue that it is always tried to clone entire GIT repository to my local file system.
If the GIT repository having huge data somewhere around 2GB then it will create such big repo in my local file system.
This will also create lots of data transfer.

I just wanted to modify and check-in only single file at specific folder location of GIT repository.
I don't want to clone entire repo in my local file system for this.

If I use no checkout option while cloning and then commit and PUSH single file to remote repo then it will PUSH entire working tree to GIT repo and all other existing folders and files get removed from remote repo.
Please let me know if there is any solution by using JGIT library.
Re: JGit PUSH only Single File [message #1789931 is a reply to message #1787560] Thu, 31 May 2018 21:56 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1032
Registered: July 2009
Senior Member
This is how git works in general. It's a distributed versioning system which means that you first clone the repository.
Native git supports shallow clone which allows to restrict the number of versions you download during clone.
Though this is not yet supported by JGit [1]

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=475615
Previous Topic:What is the action for CVE 2018-11234 and CVE 2018-11235?
Next Topic:Howto avoid subfolder with remote push
Goto Forum:
  


Current Time: Thu Sep 20 22:22:02 GMT 2018

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

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

Back to the top