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
3
votes
1 answer

JGit - Create Merge Requests through Java

Looking through the JGit API for a way to create a Merge Request in GItlab. Is there a way to get it done?
code-geek
  • 441
  • 1
  • 8
  • 22
3
votes
1 answer

Pushing files to remote repository using jGit

I need to programattically push files using jGit from different local repositories to one remote repository hosted on Github. The code below works with no exceptions, but nothing is being changed in Github. Every user defined 'group' in my program…
Kyrix
  • 61
  • 2
  • 9
3
votes
0 answers

JGit requires authentication but git on the commandline doesn't

I'm implementing a happy path git push with JGit. Situation: I have a git repository (local) that links to a remote git repository (origin) git on my machine has been configured with git config --global credential.helper wincred The first time I…
user640853
  • 163
  • 10
3
votes
1 answer

Get modified files from locally cloned Git repository using Java

In a cloned git repository, I want to pick only the files that are modified (i.e, files that are ready to commit or which are shown as 'modified' if I run the command 'git status'). I do not want to do it on date change comparison as files could…
JavaYouth
  • 1,536
  • 7
  • 21
  • 39
3
votes
1 answer

JGIT - Get every authorized private project

I'm trying to get every project that a given user is authorized to "see". For example, when I log into my GitLab account i'm able to choose (from the dashboard) which project I want to explore. So, what I need is to get that "list" dynamically with…
TeslardG
  • 33
  • 7
3
votes
0 answers

JGiT pull hanging

I am doing git pull by the following commands : Repository localRepo = new FileRepository(file.getAbsolutePath() + "/.git"); final Git git1 = new Git(localRepo); PullCommand pullCmd = git1.pull().setCredentialsProvider(new…
Kallol Ghose
  • 161
  • 9
3
votes
1 answer

How to do gitpush using jgit API?

I have used below code to do push. public static void main(String[] args) throws IOException,GitAPIException { Repository localRepo = new FileRepository("C:\\Users\\Joshi\\Desktop\\demo"); Git git = new Git(localRepo); // add remote repo: …
NikitaJ
  • 53
  • 1
  • 7
3
votes
3 answers

git-upload-pack not permitted using JGIT

My intent here is to use a "Personal Access Token" to be able to clone/pull from this repo (GitLab) in a java application. I just can't figure out how to get around this error. Here is the code I have. String accessToken =…
Dave F
  • 116
  • 1
  • 5
3
votes
1 answer

Switch git provider in buildnumber-maven-plugin

When using the buildnumber-maven-plugin, the execution fails when no git executable is in the %PATH% during a build on command line: [ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create (default) on project test:…
SilverNak
  • 3,283
  • 4
  • 28
  • 44
3
votes
2 answers

Authentication with private BitBucket repository to clone with JGit

I want to clone a remote private Atlassian BitBucket repository to my computer. Could you please describe the process how it can be done. I'm especially interested in the authentication process. Do I need to use (for Atlassian BitBucket)…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
3
votes
1 answer

Jgit clone with git lfs enabled repository not working

Current setup I have a repository which is git lfs is enabled. There is another level of authentication present for accessing the drive where lfs content is stored. When I run the below code from command prompt it asks for the username and password…
aoswal
  • 53
  • 8
3
votes
0 answers

Gerrit replicating to gitolite fails

I have configured the replication with following configurations $cat /var/gerrit/review_site/etc/replication.config [gerrit] autoReload=true [remote "bt-git"] projects = ^vt-(.*)$ push = refs/heads/*:refs/heads/* url =…
3
votes
1 answer

Accessing modified files in repository using JGit

I am using JGit to access a local repository using Java. I need to access the changed files of a repository which is typically executed using the git status command in git. What is the JGit implementation for this command? So basically I need the…
Jay
  • 4,873
  • 7
  • 72
  • 137
3
votes
1 answer

JGit checkout previous commit

How to tell JGit to checkout its parent? For example, if I have a situation like the one below on the master branch: c815b27 newestCommit (HEAD -> master, origin/master, master) e46dcaf previousCommit b2d6867 previousPreviousCommit I would like to…
chao
  • 1,893
  • 2
  • 23
  • 27
3
votes
1 answer

How to get all commits without downloading to local system with JGit?

that I need to get all commits from a remote repository. This is how I clone a repository to a local system, but it's not a good idea to download all files because there is so much. git =…
Daria
  • 347
  • 2
  • 5
  • 18