Skip to content
Advertisement

Tag: jgit

Jgit – checkout from a specific branch

I am using jgit. I want to create and checkout a new branch. I have seen the git.checkout.createnewbranch command. Is there a way to specify the base branch for the checkout, say “test” (or) we have to checkout,pull “test” first and then checkout/create the new branch from it? Answer Yes, it’s possible: Don’t forget to call git.close() or use try-with-resources

Get latest tag in branch with JGit

I am trying to get the JGit equivalent of the command I have tried getting all the tags in the project and then finding the greatest tag in the branch via the BranchListCommand, but that is to slow. I am stuck and I cannot find anything that help via my searches. Does anyone have any idea how to do the

Why object from Git.tagList().call() is not a tag?

I’m trying Jgit and I want to retrieve all tags of a cloned repository and I want to sort them by Date. That’s why I’m trying the following: The problem is that some of Ref returned by this.taglist = new Git(repository).tagList().call() are not Tag: in fact an exception is raised by parseTag() and its message is: org.eclipse.jgit.errors.IncorrectObjectTypeException: Object 3ea2b388b5ef02622312fe08e6935a5f9c655e00 is

Get the latest commit in a repository with JGit

I want to get the last commit metadata (the youngest one by date) in a repository using JGit. I know that I can get the commit metadata using: But how to get the latest commit hash? Is there any other way to get the youngest by date RevCommit in a repository directly? Answer Compare by dates of last commits in

How to get the file list for a commit with JGit

I have been working on a Java based product for which the Git features are going to be integrated. Using one of the Git features, I have done adding 10+ files into the Git repository by staging followed by committing them in a single commit. Is the reverse of the above process possible? I.e Finding the list of files committed

Advertisement