Over a million developers have joined DZone.

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

Discover how powerful static code analysis and ergonomic design make development not only productive but also an enjoyable experience, brought to you in partnership with JetBrains

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!

Learn more about Kotlin, a new programming language designed to solve problems that software developers face every day brought to you in partnership with JetBrains.

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

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}