Groovy Documentation

org.ajoberstar.gradle.git.tasks
[Java] Class GitReset

java.lang.Object
  org.gradle.api.DefaultTask
      org.ajoberstar.gradle.git.tasks.GitBase
          org.ajoberstar.gradle.git.tasks.GitReset

public class GitReset
extends GitBase

Task to reset the current HEAD of a local Git repository to the specified state.

Authors:
Alex Lixandru
Since:
0.2.1


Method Summary
java.lang.Object getMode()

Gets the reset mode.

java.util.List getPaths()

Gets the paths to reset.

java.lang.String getRef()

Gets the ref to reset.

void paths(java.lang.Object... resetPaths)

Adds paths to be reset.

void reset()

Reset the changes as configured.

void setMode(java.lang.Object mode)

Sets the reset mode

void setPaths(java.util.List resetPaths)

Sets the paths for the reset command.

void setRef(java.lang.Object ref)

Sets the ref to reset.

 
Methods inherited from class GitBase
getGit, getRepoDir, setRepoPath
 

Method Detail

getMode

@Option
al
	public
public java.lang.Object getMode()
Gets the reset mode.
Returns:
the reset mode; either soft, mixed, hard, merge or keep


getPaths

public
public java.util.List getPaths()
Gets the paths to reset.
Returns:
the paths to reset


getRef

public
public java.lang.String getRef()
Gets the ref to reset. If not set, it will default to HEAD.
Returns:
the branch to fetch


paths

public void paths(java.lang.Object... resetPaths)
Adds paths to be reset.
Parameters:
resetPaths - the paths to be reset


reset

tion
	public
public void reset()
Reset the changes as configured.


setMode

public void setMode(java.lang.Object mode)
Sets the reset mode
Parameters:
mode - the reset mode specification. Must be one of the following values:
  • soft, for soft reset,
  • mixed, for mixed reset
  • hard, for hard reset
  • merge, for merge reset
  • keep, for keep reset


setPaths

ssWarnings("unchecked")
	public
public void setPaths(java.util.List resetPaths)
Sets the paths for the reset command.

As per Git's reset command manual, no path should be added if the mode property has been set.

Parameters:
resetPaths - the paths to be reset


setRef

public void setRef(java.lang.Object ref)
Sets the ref to reset. Defaults to HEAD.
Parameters:
ref - the ref to reset


 

Groovy Documentation