public class RmCommand extends GitCommand<DirCache>Remove files from the index and working directory (or optionally only from the index).
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
Remove file "test.txt" from both index and working directory:
Remove file "new.txt" from the index (but not from the working directory):
- See Also:
- Git documentation about Rm
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
addFilepattern(String filepattern)Add file name pattern of files to be removed
setCached(boolean cached)Only remove the specified files from the index.
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
addFilepatternAdd file name pattern of files to be removed
filepattern- repository-relative path of file to remove (with
public RmCommand setCached(boolean cached)Only remove the specified files from the index.
trueif files should only be removed from index,
falseif files should also be deleted from the working directory
public DirCache call() throws GitAPIException, NoFilepatternException
Execute the command
Rmcommand. Each instance of this class should only be used for one invocation of the command. Don't call this method twice on an instance.