/** * Return a command object to execute a {@code reset} command * * @see <a href= * "http://www.kernel.org/pub/software/scm/git/docs/git-reset.html" * >Git documentation about reset</a> * @return a {@link org.eclipse.jgit.api.ResetCommand} used to collect all * optional parameters and to finally execute the {@code reset} * command */ public ResetCommand reset() { return new ResetCommand(repo); }
/** * Returns a command object to execute a {@code reset} command * * @see <a * href="http://www.kernel.org/pub/software/scm/git/docs/git-reset.html" * >Git documentation about reset</a> * @return a {@link ResetCommand} used to collect all optional parameters * and to finally execute the {@code reset} command */ public ResetCommand reset() { return new ResetCommand(repo); }
/** * Return a command object to execute a {@code reset} command * * @see <a href= * "http://www.kernel.org/pub/software/scm/git/docs/git-reset.html" * >Git documentation about reset</a> * @return a {@link org.eclipse.jgit.api.ResetCommand} used to collect all * optional parameters and to finally execute the {@code reset} * command */ public ResetCommand reset() { return new ResetCommand(repo); }
new ResetCommand(repo).setMode(ResetType.HARD).call();
/** {@inheritDoc} */ @Deprecated @Override public void reset(boolean hard) throws GitException, InterruptedException { try (Repository repo = getRepository()) { ResetCommand reset = new ResetCommand(repo); reset.setMode(hard?HARD:MIXED); reset.call(); } catch (GitAPIException e) { throw new GitException(e); } }
new ResetCommand(repo).setMode(ResetType.HARD).call();
new ResetCommand(repo).setMode(ResetType.HARD).call();