Tag: java

Trying to download an exe file from a website and run it

I am having trouble downloading an exe file from a server and running it. specifically downloading git and installing it automatically. I found some code on another question that isn’t quite working, and I don’t know why. The parameters I pass it are: URL url = new URL(“http://git-scm.com/download/win”); String fileName = “C:/SETUP/gitinstall.exe”; Am thinking maybe […]

How to hard reset from one git branch to other in JGit?

I have two branches one is master and another one level1. Now level1 is the latest I need to hard reset master to level1 normally in git bash I can do that by following command. $ git checkout master $ git tag old-master-branch $ git reset –hard level1 $ git merge -s ours origin/master $ […]

JGit create new local branch and push to remote (branch does not exist on remote)

I’m working on an ANT task that calls some java that uses JGit to create a new branch on a git repository and push it to remote. I’m using JGit 2.1.0. Here’s the code: CreateBranchCommand bcc; CheckoutCommand checkout; Git git; try { Repository repo = new FileRepositoryBuilder().readEnvironment().findGitDir(src).build(); git = new Git(repo); bcc = git.branchCreate(); checkout […]

git clone does not work in java

I am using jgit to clone a repository of using java code. I am able to clone to a local (windows) machine when testing, but unable to clone to a aws server. Folder is not created in local path. I am creating the clone under /tmp/loc/$proName. I gave 777 to the loc folder, but not […]

git java wrapper – git pull never ends

I’m creating a simple Java wrapper for git executable, that I want to use in my app. A small code example: public static void main(String[] args) { String gitpath = “C:/eclipse/git/bin/git.exe”; File folder = new File(“C:/eclipse/teste/ssadasd”); try { folder.mkdirs(); Runtime.getRuntime().exec( gitpath + ” clone git@”, null, folder); } catch (IOException e) { e.printStackTrace(); } } […]

Crawling GitHub with JGit

I’m trying to crawl a GitHub Wiki with JGit. When I try it with one URL, it worked perfectly fine. Then I tried it with another random URL and got an error. Please see the extract of my code: import java.io.File; import java.io.IOException; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; public class Main { // with this URL […]

How to stage files with JGit in a bare repository?

I read the question and answer for staging files in a non-bare repository. However, I am working with a bare repository and I would like to stage files. I tried using the test for DirCacheBuilder, but the code Repository.lockDirCache() or Repository.readDirCache() fails because this is a bare repository. org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working […]

Playframework 2 – Deploying to ec2

I know that i can use the play dist command to upload it to an ec2 instance without any problems but the size is 35mb and I don’t want to wait 60min for every tiny change. (I have dsl 1000) Is it possible to use something like heroku where you just push your changes via […]

How redeploy application on Google App Engine?

I couldn’t find it in the documentation, so help me please. When I want to deploy WAR file to Google App Engine, I just clone it from git in the cloud shell and press mvn appengine:deploy And application successfully deploys and starts. So I have a question, when I’m fixing something, pushing in git, how […]

Gerrit remove Need Verified +1 (Verified)

I just installed a Gerrit server and wish to get rid of the Need Verified +1 (Verified) permission. Our team would only like to +2 changes instead of doing both things. I tried following the steps at http://review.coreboot.org/Documentation/access-control.html#category_CVRW DELETE FROM approval_categories WHERE category_id = ‘VRIF’; DELETE FROM approval_category_values WHERE category_id = ‘VRIF’; But I’m running […]

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