Tag: java

How can I get the SHA of a GitHub commit in Java?

I’d like to know if there is a hacky method to obtain a commit SHA of the latest commit of a branch in a particular GitHub repo in Java. As far as I have seen, the GitHub API only has a hook to access the full commit info, not just the API. Anybody have any […]

Eclipse git plugin and a method to fetch current branch – commit id to Java code version info string

I’m using git plugin for Eclipse, as do my daily build, it becomes difficult to track which version of the build from the git is been tested. Unless there is way to auto fetch the branch and commit id from the git plugin and generate a static String version information in the code during each […]

Controlling Which GIT Branch is Deployed to AWS ElasticBeanstalk via Eclipse Plugin

I’m using GIT and the feature-branch workflow for my local development. I’m also using the AWS SDK / Eclipse plugin for my application deployments to my ElasticBeanstalk Tomcat server. Recently I encountered a problem where new Java classes I had added to my codebase were not being deployed to ElasticBeanstalk (i.e., the compiled class files […]

Netbeans Maven project from cloned GitHub Java (with jni and C) repository

I cloned the git repository here and I would like to add it as a Maven or NetBeans Java project in NetBeansso I can use it as dependency for other application and to also be able to contribute to the repository. The problem is that after cloning it NetBeans does not allow me to add […]

Custom git push ant task wont work in JGit

I’m trying to complete my custom git-push ant task using JGit which should push stated branch to remote repository but it seems not to be working. Here’s my Java code for the task: public void setRepository(String repository) { this.repository = repository; } public void setPassword(String password) { this.password = password; } public void setUsername(String username) […]

Why does “git pull” exec command get stuck and print nothing?

When executing the following command, I am prompted to type the password: $ git pull Enter passphrase for key (…) When I try to show the same information programatically using Apache Commons Exec, the program gets stuck and doesn’t print anything: CommandLine cmd = new CommandLine( “git” ); cmd.addArgument( “pull” ); DefaultExecutor executor = new […]

Android balanced-api import error

I’ve been having issues importing the balanced-api for Android into eclipse. I cloned the project from their git repo: https://github.com/balanced/balanced-android However every time I attempt to import the project I receive the following error: “Cannot nest ‘balanced-android/src/main/java‘ inside ‘balanced-android/src’. To enable the nesting exclude ‘main/’ from ‘balanced-android/src’ I’m also not to sure what this error […]

Whats the easiest way to move project Java from java.net to bitbucket

This question already has an answer here: How to migrate SVN repository with history to a new Git repository? 30 answers

Example of gitignore file for java

Can you show me example of .gitignore file for java, that consider a lot of different files that are not included(jar, war, classpath, files that IDEA and other IDE generates and so on and on). I mean really big .gitignore. What I currently have is **/target/ /target/ */target/* .classpath .project .settings # Package Files # […]

Git project in eclipse disappeared from workspace after a pull

My Java Project disappeared from the Project Explorer after I performed the following actions with egit: Commit Successfully performed Push to upstream Didn’t succeed (not sure about the reason but I think it was because a pull was required first) Pull Egit says the project merged successfully After I closed the window containing the info […]

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