Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.PushCommand


     * Pushes local repository upstream
     *
     * @param credentialsProvider the credentials provider to get SSH pass phrase
     */
    public void push(CredentialsProvider credentialsProvider) {
        PushCommand push = git.push();
        push.setCredentialsProvider(credentialsProvider);
        try {
            push.call();
        } catch (JGitInternalException e) {
            throw new IllegalStateException("Unable to push into remote Git repository", e);
        } catch (InvalidRemoteException e) {
            throw new IllegalStateException("Unable to push into remote Git repository", e);
        } catch (TransportException e) {
View Full Code Here


        session.setUserInfo(userInfo);
      }
    };
    SshSessionFactory.setInstance(sessionFactory);

    PushCommand pushCommand = repo.push().setRemote(remoteUrl).add("master").setProgressMonitor(new TextProgressMonitor()).setForce(true);
       
    pushCommand.call();

    // repo.push().setRemote("")
  }
View Full Code Here

    Git git;
    try {
      repository = getRepository();
      git = Git.wrap(repository);

      PushCommand pushCommand = git.push();
      pushCommand.setRemote(remoteLocation);
      pushCommand.setRefSpecs(new RefSpec(repository.getFullBranch()));

      Iterable<PushResult> pushResult = pushCommand.call();
      Iterator<PushResult> result = pushResult.iterator();

      StringBuffer buffer = new StringBuffer();
      if (result.hasNext()) {
        while (result.hasNext()) {
View Full Code Here

     * Pushes local repository upstream
     *
     * @param credentialsProvider the credentials provider to get SSH pass phrase
     */
    public void push(CredentialsProvider credentialsProvider) {
        PushCommand push = git.push();
        push.setCredentialsProvider(credentialsProvider);
        try {
            push.call();
        } catch (JGitInternalException e) {
            throw new IllegalStateException("Unable to push into remote Git repository", e);
        } catch (InvalidRemoteException e) {
            throw new IllegalStateException("Unable to push into remote Git repository", e);
        }
View Full Code Here

TOP

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

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.