Over a million developers have joined DZone.

A New Java Library: ParallelGit

DZone's Guide to

A New Java Library: ParallelGit

DZone user Junyi Bei showcases a new open source library called ParallelGit, to help manipulate your local Git repository.

· Java Zone ·
Free Resource

Build vs Buy a Data Quality Solution: Which is Best for You? Gain insights on a hybrid approach. Download white paper now!

Hi all. Just published an open source library to the Maven Central Repository. As the author of this project, I am here to shout out the exciting news :)

ParallelGit is a library to help you manipulate your local Git repository. It allows you to access your repository as it were a native file system (via Java 7 nio FileSystem interface).

public void copyFileToRepository() {
  Repository myRepo = RepositoryUtils.openRepository(new File("/home/repository"));
  try(GitFileSystem master = GitFileSystemBuilder.forRevision("master", myRepo))) {
    Path fileInRepo = master.getPath("/myFile.txt");
    Files.copy(Paths.get("/home/myFile.txt"), fileInRepo);
    Requests.commit(master).message("copied myFile.txt").execute();

For more information and examples, please visit Github/ParallelGit and its official site.

Thank you for your attention!

Build vs Buy a Data Quality Solution: Which is Best for You? Maintaining high quality data is essential for operational efficiency, meaningful analytics and good long-term customer relationships. But, when dealing with multiple sources of data, data quality becomes complex, so you need to know when you should build a custom data quality tools effort over canned solutions. Download our whitepaper for more insights into a hybrid approach.

java ,git ,jgit ,github ,nio ,filesystem ,java 7 ,java 1.7 ,fs

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}