Class PushCommand

    • Constructor Detail

      • PushCommand

        protected PushCommand​(Repository repo)
        Parameters:
        repo -
    • Method Detail

      • setRemote

        public PushCommand setRemote​(String remote)
        The remote (uri or name) used for the push operation. If no remote is set, the default value of Constants.DEFAULT_REMOTE_NAME will be used.
        Parameters:
        remote -
        Returns:
        this
        See Also:
        Constants.DEFAULT_REMOTE_NAME
      • getRemote

        public String getRemote()
        Returns:
        the remote used for the remote operation
      • setReceivePack

        public PushCommand setReceivePack​(String receivePack)
        The remote executable providing receive-pack service for pack transports. If no receive-pack is set, the default value of RemoteConfig.DEFAULT_RECEIVE_PACK will be used.
        Parameters:
        receivePack -
        Returns:
        this
        See Also:
        RemoteConfig.DEFAULT_RECEIVE_PACK
      • getReceivePack

        public String getReceivePack()
        Returns:
        the receive-pack used for the remote operation
      • getTimeout

        public int getTimeout()
        Returns:
        the timeout used for the push operation
      • getProgressMonitor

        public ProgressMonitor getProgressMonitor()
        Returns:
        the progress monitor for the push operation
      • setProgressMonitor

        public PushCommand setProgressMonitor​(ProgressMonitor monitor)
        The progress monitor associated with the push operation. By default, this is set to NullProgressMonitor
        Parameters:
        monitor -
        Returns:
        this
        See Also:
        NullProgressMonitor
      • getRefSpecs

        public List<RefSpec> getRefSpecs()
        Returns:
        the ref specs
      • setRefSpecs

        public PushCommand setRefSpecs​(RefSpec... specs)
        The ref specs to be used in the push operation
        Parameters:
        specs -
        Returns:
        this
      • setRefSpecs

        public PushCommand setRefSpecs​(List<RefSpec> specs)
        The ref specs to be used in the push operation
        Parameters:
        specs -
        Returns:
        this
      • setPushAll

        public PushCommand setPushAll()
        Push all branches under refs/heads/*.
        Returns:
        {code this}
      • setPushTags

        public PushCommand setPushTags()
        Push all tags under refs/tags/*.
        Returns:
        {code this}
      • add

        public PushCommand add​(Ref ref)
        Add a reference to push.
        Parameters:
        ref - the source reference. The remote name will match.
        Returns:
        this.
      • add

        public PushCommand add​(String nameOrSpec)
        Add a reference to push.
        Parameters:
        nameOrSpec - any reference name, or a reference specification.
        Returns:
        this.
        Throws:
        JGitInternalException - the reference name cannot be resolved.
      • isDryRun

        public boolean isDryRun()
        Returns:
        the dry run preference for the push operation
      • setDryRun

        public PushCommand setDryRun​(boolean dryRun)
        Sets whether the push operation should be a dry run
        Parameters:
        dryRun -
        Returns:
        this
      • isThin

        public boolean isThin()
        Returns:
        the thin-pack preference for push operation
      • setThin

        public PushCommand setThin​(boolean thin)
        Sets the thin-pack preference for push operation. Default setting is Transport.DEFAULT_PUSH_THIN
        Parameters:
        thin -
        Returns:
        this
      • isForce

        public boolean isForce()
        Returns:
        the force preference for push operation
      • setForce

        public PushCommand setForce​(boolean force)
        Sets the force preference for push operation.
        Parameters:
        force -
        Returns:
        this
      • setOutputStream

        public PushCommand setOutputStream​(OutputStream out)
        Sets the output stream to write sideband messages to
        Parameters:
        out -
        Returns:
        this
        Since:
        3.0