Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.InitCommand


      else return lastUsedPage.getData().getContent();
}

  public boolean initialiseGitRepository() throws GitAPIException {
    FileUtil.createDir(TEST_DIR);
    new InitCommand()
            .setDirectory(new File(TEST_DIR))
            .setBare(false)
            .call();
    return true;
  }
View Full Code Here


                } catch (Throwable e) {
                    getLog().error("Failed to command remote repo " + repo + " due: " + e.getMessage(), e);
                    // lets just use an empty repo instead
                }
            } else {
                InitCommand initCommand = Git.init();
                initCommand.setDirectory(buildDir);
                git = initCommand.call();
                getLog().info("Initialised an empty git configuration repo at " + getGitBuildPathDescription());

                // lets add a dummy file
                File readMe = new File(buildDir, "ReadMe.md");
                getLog().info("Generating " + readMe);
View Full Code Here

                    // lets just use an empty repo instead
                }
            } else if (!isCloneRemoteRepoOnStartup()) {
                LOG.info("Clone git repo on startup disabled");
            }
            InitCommand initCommand = Git.init();
            initCommand.setDirectory(confDir);
            git = initCommand.call();
            LOG.info("Initialised an empty git configuration repo at {}", confDir.getCanonicalPath());

            String branch = git.getRepository().getBranch();
            configureBranch(branch);
View Full Code Here

      }
    }
   
    private void initGit() throws GitAPIException {
      // create the repository
      InitCommand init = Git.init();
      init.setBare(false);
      init.setDirectory(newProject.dir);
      Git git = init.call();
     
      if (!StringUtils.isEmpty(newProject.gitOrigin)) {
        // set the origin and configure the master branch for merging
        StoredConfig config = git.getRepository().getConfig();
        config.setString("remote", "origin", "url", getGitUrl());
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.api.InitCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.