Class ResetCommand

  • All Implemented Interfaces:
    Callable<Ref>

    public class ResetCommand
    extends GitCommand<Ref>
    A class used to execute a Reset command. It has setters for all supported options and arguments of this command and a call() method to finally execute the command. Each instance of this class should only be used for one invocation of the command (means: one call to call())
    See Also:
    Git documentation about Reset
    • Constructor Detail

      • ResetCommand

        public ResetCommand​(Repository repo)

        Constructor for ResetCommand.

        Parameters:
        repo - the Repository
    • Method Detail

      • setRef

        public ResetCommand setRef​(String ref)
        Set the name of the Ref to reset to
        Parameters:
        ref - the ref to reset to, defaults to HEAD if not specified
        Returns:
        this instance
      • addPath

        public ResetCommand addPath​(String path)
        Repository relative path of file or directory to reset
        Parameters:
        path - repository-relative path of file/directory to reset (with / as separator)
        Returns:
        this instance
      • disableRefLog

        public ResetCommand disableRefLog​(boolean disable)
        Whether to disable reflog
        Parameters:
        disable - if true disables writing a reflog entry for this reset command
        Returns:
        this instance
        Since:
        4.5
      • isReflogDisabled

        public boolean isReflogDisabled()
        Whether reflog is disabled
        Returns:
        true if writing reflog is disabled for this reset command
        Since:
        4.5