952 questions
0
votes
0
answers
39
views
Jgit silently failing on commit push - why is it suppressing the error?
If my remote has commits on it that I would overwrite by pushing, JGit fails silently and does not present an error message. If I do a manual push from my local repo, Git CLI throws an error that I ...
0
votes
0
answers
48
views
How to find parents of a commit
I have a workflow in which specially named branches are used to identify "fixes" for things, and I'm trying to write a tool in JGit to manage them.
Within a git tree, a fix branch can be ...
0
votes
0
answers
29
views
Can I use ArchiveCommand to implement the command 'git archive -- remote=origin -- output=archive. zip' on my git server?
Can I use ArchiveCommand to implement the command 'git archive -- remote=origin -- output=archive. zip' on my git server? The client keeps reporting this error 'fatal: protocol error: bad line length ...
-3
votes
1
answer
54
views
How to determine detached head state
I am using JGit to do some manipulation of a repo.
Is there an easy way for me to be sure that a repo is/isn't in a detached head state?
The best I've come up with so far is to use Repository....
0
votes
1
answer
436
views
JGit - Cannot invoke "org.eclipse.jgit.transport.SshSessionFactory.getSession" because "this.sch" is null
I am trying to clone a git repo locally through the java code that I have. And this is how it looks like:
class Scratch {
public static void main(String[] args) {
String repoName = "https://...
0
votes
0
answers
147
views
Creating directories for */.git failed
I used JGit library for cloning and pulling repository in my app.
Git clone code:
Git.cloneRepository()
.setURI(remoteURL)
.setDirectory(repoDir)
...
0
votes
0
answers
39
views
jGit get ObjectId's of conflicting file
I use jGit and the status() command to list the conflicting files.
I want to load the two versions of a file in status CONFLICTING, and solve the conflict by myself. OpenAI suggested the code below.
...
1
vote
0
answers
53
views
how to specify the author of commit created by revert() in JGit?
Suppose there is a file that is added and committed to a Git repository with the change reverted:
try (Git gitParent = Git.init().setDirectory(parentRepositoryRoot).call()) {
final String fooName =...
0
votes
0
answers
39
views
How do I check jgit setCloneAllBranches() clones all branches to my local [duplicate]
I am trying to clone a git repository into my local using the following code:
repo = Git.cloneRepository()
.setCloneAllBranches(true)
.setBranch(branch)
.setCredentialsProvider(new ...
0
votes
0
answers
88
views
wrong commit info of jgit blame
I have a file , the git blame info of git command git blame a.java like this:
just like the blame info of Jetbrains IDEA "Annotate with Git Blame".
But when I use jgit "BlameCommand&...
1
vote
1
answer
247
views
Initialize an InMemoryRepository with Jgit from scratch
I am trying to create an InMemoryGitRepository from scratch. Ultimately, I would like to try a custom DFSRepository as git backend, but to begin with I was playing around with the default ...
0
votes
1
answer
104
views
JGit, remove tags no longer in remote
This is a question specific to the JGit api.
I would like to replicate in JGit the same behavior of the following Git command:
git fetch --prune --prune-tags, which basically removes, from the local ...
0
votes
0
answers
29
views
jGit Push not always visible in GitHub Activity page
I use jGit to manage repositories, and I have a question related to push().
The issue: not all pushes are visible in the GitHub activity page.
In the workflow below, Ben is pushing a change to GitHub ...
0
votes
1
answer
265
views
CONNECT through proxy removes additional headers required for authorization
I am using Jgit library to provide git functionality in our application. When a git operation like clone is executed for cloning HTTPS repo, the request needs to go through an embedded jetty based ...
0
votes
1
answer
147
views
In java JGit, How to remove all commits from remote repository except the most recent one
I am using eclipse JGit API on my java project to mange remote GitHub repository and so far I can use JGit to commit local changes to remote. But I have these requirements that I will only need to ...