I have a large (several GB) Git repository. I want some application to create small files within that repository and commit the changes. This should happen without checking out those gigabytes to the disk.
I found a JGit code sample in which a remote repository is cloned into an in-memory respository.
Can I use JGit (something like shown below) in order to add a file to a remote repository without checking it out locally (i. e. without transferring gigabytes of data to the machine where that code will run)?
DfsRepositoryDescription repoDesc = new DfsRepositoryDescription();
InMemoryRepository repo = new InMemoryRepository(repoDesc);
Git git = new Git(repo);
git.remoteAdd();
git.commit();
Update 1: The size of the entire directory (tracked files plus .git
) is 1.2G
. The size of .git
alone is 573M.
% du -hs .
1.2G .
% du -hs .git
573M .git