Tag: java

JGit clone fails from gerrit without username or password

I am having problems with JGit version 3.0.0.201306101825-r. Here is my clone function: public static void cloneRepository(String localRepositoryPath, String remoteRepositoryURI, String branch, String username, String password) throws IOException, InvalidRemoteException, GitAPIException { File workDir = createFolder(localRepositoryPath); CloneCommand clone = Git.cloneRepository(); clone.setBare(false); clone.setCloneAllBranches(false); clone.setBranch(branch); clone.setDirectory(workDir).setURI(remoteRepositoryURI); if (StringUtils.isNotEmpty(username)) { UsernamePasswordCredentialsProvider credentials = new UsernamePasswordCredentialsProvider(username, password); clone.setCredentialsProvider(credentials); } Git […]

Single login to SSH, share the session to run git-receive-pack and remotely run some other commands

With only one login to SSH (to reduce login time), How do I run some other commands and as well as pushing git repository in the middle? e.g. login to remote via SSH remote: cd abc remote: git init local: git push –> Question: How can I substitute with remote commands directly so I can […]

Retrieving Branches from GIT url using java code

Currently I’m working on Jgit API to create a branch from source code. I have created the branch successfully and when I create branch I need to validate the branch name shouldn’t exists in the current GIT repositary(Online URL : Ex.https://github.com/varunkumar-s/test.git). Here I want to do list out the branch names from the above url […]

Need GitBlit groovy hook which push changed to other Gitblit server repo

Need a groovy push hook scripts from your Gitblit instance to another Gitblit instance I have two private linux servers, Say A and B with GitBlit install on both. All developers do commit and push their changes on server A, I want B keep in sync with A. There is some Groovy hook but I […]

build spring framework source code encounter an error

I fetched the spring framework source code from github by using git clone command. When I build the source code by using gradle build in the source code directory,it takes a long time to download dependencies and compile the java code,but failed with an exception.The output is below. :spring-webmvc-portlet:sourcesJar UP-TO-DATE :spring-webmvc-tiles2:javadoc SKIPPED :spring-webmvc-tiles2:javadocJar SKIPPED :spring-webmvc-tiles2:sourcesJar […]

Putting version file into EAR or WAR using Maven

My firm is trying to find a way to put some type of version file or versioning on a EAR and or WAR using Maven. What we need is as we do the Maven Build is to take a version number out of a file and somehow put it into a EAR or WAR or […]

Switching branches with IntelliJ & Git

this should be an easy one… I’m trying IntelliJ (came from Eclipse) and I have this issue that I don’t know how to handle, I have configured my project using the branchA no problems, but, as soon a try to checkout another branch branchB the IDE tells me that fails due some untracked file that […]

Subversion or Mercurial SPI – What API shall a server implement?

I’m trying to evaluate a product idea that (besides the main, non-disclosed functionality) would provide a “revision control”-style secondary view of the content/changes. I expect many users, and I wouldn’t create real repositories, I would like to store my internal data as I see fit – I would like to just emulate the Subversion or […]

Can a Git Repository Branch be a sub folder in some other Git Repository?

Can a Git Repository Branch be a sub folder in some other Git Repository? What I mean by this is if I am working in a git repository called “webdesign” and it has a branch called “JSP” can I somehow map a folder in my “project-a” repository to add the branchs. I would like to […]

Including .jar files in Github for consistency

I am new to using github and have been trying to figure out this question by looking at other people’s repositories, but I cannot figure it out. When people fork/clone repositories in github to their local computers to develop on the project, is it expected that the cloned project is complete (ie. it has all […]

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