Questions tagged [jgit]

JGit is an EDL (new-style BSD) licensed, lightweight, pure Java library implementing the Git version control system.

JGit is an EDL (new-style BSD) licensed, lightweight, pure Java library implementing the version control system.

It is developed as part of the Eclipse Git Plugin .

JGit Supports:

  • Repository access routines
  • Network protocols
  • Core version control algorithms
  • Implementation of many porcelain commands
  • tasks for performing Git operations as part of automated builds
  • A Git daemon to provide a simple Git server
  • A jgit commandline tool for working with Git repositories

For details visit the Project page or the User Guide, there is also API Documentation available.

The community-provided jgit-cookbook provides ready-to-run snippets that show how things can be achieved when using JGit

956 questions
0
votes
1 answer

jGit push produces exception

I am trying to use jGit in my java project. The version I am using is "2.0.0.201206130900-r" and my OS is Windows. everything worked fine until i tried to do a push: public static void main(String[] args) { File gitDir = new…
-1
votes
1 answer

Create git repo with jgit and put a file into it

I have the following code to generate a new git repo and put a .gitignore into it: Repository repo = new FileRepositoryBuilder().setGitDir(gitProjectDir.toFile()) .setWorkTree(gitProjectDir.toFile()) .build(); repo.create(); …
J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
-1
votes
0 answers

Fetch all files with extension.txt from a github repo main branch using JGit

I'm currently working on a Java Spring project and I need to retrieve all the .txt files from a specific folder in a GitHub repository using the JGit library. I have been exploring the JGit documentation, but I'm having trouble figuring out the…
Liron Tal
  • 11
  • 3
-1
votes
1 answer

How to get id of commit after committing using JGit Library

I am using the below code to commit my changes. CommitCommand commitCommand = git.commit(); commitCommand.setMessage("My change"); commitCommand.setAuthor(name, name + "@xyz.com"); commitCommand.call(); I want to know the commit id of this change.…
-1
votes
1 answer

Find commits on one branch that aren't on another with JGit

I'm trying to find commits on branch foo that aren't on master. I have this working for the simple cases, but once new changes have been merged from master into foo it breaks down. In more detail: If you have commits A, B, and C on master then you…
Brad Mace
  • 27,194
  • 17
  • 102
  • 148
-1
votes
2 answers

Adding jgit as a gradle dependency prevent my main class from being loader

2 hours ago, I ws working a java (gradle) project which needed jgit. I aded it in my build.gradle, ran ./gradlew build, and tried to java -jar the build output. It does not work anymore, but removing the dependency makes it work again. Note that it…
Aang23
  • 11
  • 6
-1
votes
1 answer

JGIT Repeated Merge Conflict Null pointer exception

I would like to ask regarding the below code lines why i get null pointer Exception. Is this something Git related which i don't understand ? refsideMerge=existingRepo.exactRef("refs/heads/sideMerge"); tmpMerge =…
-1
votes
2 answers

JGit throws ClassCastException in TransportConfigCallback

I am trying to use JGit. I tried following http://www.codeaffine.com/2014/12/09/jgit-authentication/ and the following block of the code throws a ClassCastException remoteRepository.setTransportConfigCallback(new TransportConfigCallback() { …
user2427771
  • 33
  • 11
-1
votes
2 answers

How to connect to S3 bucket with Git to push and fetch data

I have been trying to find a way to git to the AWS S3 bucket. While searching, I found this blog: https://fancybeans.com/2012/08/24/how-to-use-s3-as-a-private-git-repository/. As per the blog says: I have created S3 bucket (test-git-repo) and a…
Harry Kris
  • 61
  • 2
  • 12
-1
votes
1 answer

Push changes till particular commit to remote repository with JGit

I'm able to push all local commits to a remote (bare repository) using JGit. RefSpec spec = new RefSpec("master:master"); Iterable resultIterable = git.push().setRemote("origin").setRefSpecs(spec).call(); Now I want to push changes till…
prasadK
  • 3
  • 2
-1
votes
1 answer

git push with url using JGit

I am using JGit library to push my changes to the repository. However, I want to provide the URL as well in the push command. I want the equivalent of following command in JGit: git push Is this possible with JGit? Note: Changing the config…
Anu Chawla
  • 415
  • 1
  • 4
  • 19
-1
votes
2 answers

Get Commit of a particular SHA-1 in jGit

I have a SHA-1 of a newly cloned repository. I want the author indent of this SHA-1. So I need to use RevWalk and iterate the whole repository? Or is there a findXX method or other code I can use to get the RevCommit or another object that has the…
tgkprog
  • 4,493
  • 4
  • 41
  • 70
-1
votes
3 answers

Create a Pull Request in Github from a Java Application

I'm trying to create a pull request from my Java application but I can't find any documentation for Github's Java API. I already implemented all the methods for adding a file, commit, and push. Any useful links?
user3574857
  • 377
  • 4
  • 16
-1
votes
1 answer

get the action has been performed for particular commit in git

In my local git repository,i have more than one commits for a file. How can i get status/action has been performed on that commit.I mean, how can i know on a particular commit,is that file added newly or is it been modified or is it been labeled..i…
-1
votes
1 answer

Jgit- Getting commit history of particular contributor

I am newbie to JGit (a pure java library for git works) and Git. I am trying to get commit history of particular member using java but i get nothing, to do this I am using JGit. This is my code ,I think there is an error in if statement. public…
1 2 3
63
64