Tag: java

jgit – cloning a repo creates files with my default umask permission and not the permissions in the repo

I am using jgit to clone my repository, but when I do, I notice that the permissions are not what they’re supposed to be. They match my umask setting which is undesirable since git can track the permissions and that is critical for the configuration files. Is this possible or is it simply a bug?

How to find who last changed a file with JGit

I need the user who last changed/committed a file in our GIT repository. The project consists of many subfolders, and the master branch has many merged commits. I tried : File gitWorkDir = new File(“D:/gitfolder/”); Git git = Git.open(gitWorkDir); RevCommit latestCommit; String path = “test.txt”; try( RevWalk revWalk = new RevWalk( git.getRepository() ) ) { […]

How dangerous is commiting code with plain-text passwords on a public/unsecured network? How do I properly handle passwords in code?

This question already has an answer here: Encrypt Password in Configuration Files? 12 answers

Is there a best practice on maintaining thirdparty javascript libraries in Git repo for a Java project (not Node project)?

I am working on a server side Java project. The Java code is merely 4 KB in size. However, the thirdparty JavaScript libraries (chartjs, angular, jquery, d3, etc.) consume a whopping 50 MB. Right now, the Java code as well as all the thirdparty JavaScript libraries are committed to my git repository. This allows me […]

Do I need to specify the branches to list commits between two revisions in JGit?

I want to get the list of commits between two revisions (hashes) in a repository using JGit. I don’t know if the commits (start commit hash, end commit hash) are in one branch or different ones. I know how to walk through the Tree starting from a commit in JGit. My question: Do I have […]

Jcabi Github ExceptionInInitializerError

I am currently working on a Bukkit plugin, and trying to implement to get config files from github. I am trying to use JCabi-Github for this. I got the library implemented and working, but whenever I use it, it creates an error. I tried to use this code: Github git = new RtGitHub(user, pass); Which […]

Can the Spring Cloud Config Server also push config updates to the remote git repo?

After the spring cloud config server clones the git repo and is properly serving up the files, can it also make changes to those files and push them back to the remote git repo? Or would that functionality have to be written in the application running the config server?

Jenkins giving error while giving repository URL to source code management

I’m configuring the GitHub project in Jenkins while entering all the details got struck in Source Code Management -> Git -> Repositories -> Gave the Repository URL – https://github.com/xxx/gradle-java-sample-project.git showed this message – Failed to connect to repository : Command “git ls-remote -h https://github.com/xxx/gradle-java-sample-project.git HEAD” returned status code 1: stdout: stderr: xcrun: error: invalid active […]

how to read BitBucket/Stash branches and their linked JIRA tickets with Java

I want to read bitbucket/stash branches and their respected Jira issue, when i was looking for it and found Atlassian APIs. I couldn’t find any proper examples in this, like how do I connect to bitbucket server, get information of any project, and read branches of that project, and also if there is any Jira […]

Sonarqube scan from Jenkins : ClassNotFoundException: org.eclipse.jgit.api.Git

I have a problem when doing a SonarQube Scan from Jenkins. See the stacktrace in debug mode : [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project scbm-order-parent: Unable to register extension org.sonarsource.scm.git.JGitBlameCommand from plugin ‘scmgit’: org/eclipse/jgit/api/Git: org.eclipse.jgit.api.Git -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project scbm-order-parent: Unable to register extension […]

Git Baby is a git and github fan, let's start git clone.