Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Git.push()


    Git git1 = new Git(db1);
    branch(branchesLocation1, "a");

    // clone1: push all
    // TODO: replace with REST API when bug 339115 is fixed
    git1.push().setPushAll().call();

    // clone2
    JSONObject project2 = createProjectOrLink(workspaceLocation, getMethodName().concat("Project2"), null);
    IPath clonePath2 = getClonePath(workspaceId, project2);
    clone(clonePath2);
View Full Code Here


    Git git1 = new Git(db1);
    branch(branchesLocation1, "a");

    // clone1: push all
    // TODO: replace with REST API when bug 339115 is fixed
    git1.push().setPushAll().call();

    // clone2
    JSONObject project2 = createProjectOrLink(workspaceLocation, getMethodName().concat("Project2"), null);
    IPath clonePath2 = getClonePath(workspaceId, project2);
    clone(clonePath2);
View Full Code Here

    }

    public void push() {
        final Git git = new Git(getRepository());
        try {
            for (final PushResult result : git.push().setPushAll().call()) {
                LOGGER.info(result.getMessages());
            }
        }
        catch (final Exception e) {
            throw new IllegalStateException(
View Full Code Here

                    git = Git.open(new File(repoPath + "/.git"));
                    Helper.copyDirectory(iProject.getLocation().toFile(), new File(repoPath));
                    //System.out.println("copying files ........ ");
                    git.add().addFilepattern(".").call();
                    git.commit().setMessage("Auto commit via Rich Visualforce plugin " + DateFormat.getInstance().format(System.currentTimeMillis())).call();
                    git.push().setPushAll().call();
                  }
                }else{
                  MessageDialog.openError(window.getShell() , "Project Git Repository is not a valid repository",
                      "Project Git Repository is not a valid repository. \n ProjectName: " + projectName + "\n Path: " + repoPath);
                }
View Full Code Here

        Git git =  new Git(repository);

        FileUtils.touch(new File(GitRepository.getDirectoryForMerging(project.owner, project.name + "/" + fileName)));
        git.add().addFilepattern(fileName).call();
        git.commit().setMessage(fileName).call();
        git.push().setRefSpecs(new RefSpec("master:master"), new RefSpec("master:" + branchName)).call();
        gitRepository.close();
        repository.close();
    }
}
View Full Code Here

        BufferedWriter out = new BufferedWriter(new FileWriter(testFilePath));
        out.write("hello 1");
        out.flush();
        cloneGit.add().addFilepattern(readmeFileName).call();
        cloneGit.commit().setMessage("commit 1").call();
        cloneGit.push().call();

        // Then
        Repository originRepository = GitRepository.buildGitRepository(originProject);
        String readmeFileInClone = new String(getRawFile(cloneRepository, readmeFileName));
        assertThat(readmeFileInClone).isEqualTo("hello 1");
View Full Code Here

        git.branchCreate()
                .setName(branchName)
                .setForce(true)
                .call();

        git.push()
        .setRemote(GitRepository.getGitDirectoryURL(project))
        .setRefSpecs(new RefSpec(branchName + ":" + branchName))
        .setForce(true)
        .call();
View Full Code Here

                    .setDirectory(new File(localRepoPath))
                    .call();
            Repository repo = git.getRepository();
            baseCommit = support.Git.commit(repo, repo.getWorkTree().getAbsolutePath(), "test.txt",
                    "apple\nbanana\ncat\n", "commit 1");
            git.push().setRefSpecs(new RefSpec("+refs/heads/master:refs/heads/master")).call();
        }

        // 3. 포크된 프로젝트 클론된 저장소 만들기
        GitRepository.cloneLocalRepository(project, forkedProject);
View Full Code Here

            assertThat(repo.isBare()).describedAs("projectYobi-1 must be non-bare").isFalse();
            firstCommit = support.Git.commit(repo, repo.getWorkTree().getAbsolutePath(),
                    "test.txt", "apple\nbanana\ncorn\n", "commit 1");
            secondCommit = support.Git.commit(repo, repo.getWorkTree().getAbsolutePath(),
                    "test.txt", "apple\nbanana\ncake\n", "commit 2");
            git.push().setRefSpecs(new RefSpec("+refs/heads/fix/1:refs/heads/fix/1")).call();
        }

        // 5. 그 브랜치로 projectYobi에 pullrequest를 보낸다.
        pullRequest = PullRequest.createNewPullRequest(forkedProject, project, "refs/heads/fix/1",
                "refs/heads/master");
View Full Code Here

      environmentName = curEnv.getEnvironmentName();

    String remote = new RequestSigner(getAWSCredentials(), applicationName,
        region, commitId, environmentName, new Date()).getPushUrl();

    PushCommand cmd = git.//
        push();

    cmd.setProgressMonitor(new TextProgressMonitor());

    try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.