Package com.github.gastaldi.git
Interface GitWrapper
- All Known Implementing Classes:
GitWrapperImpl
public interface GitWrapper
- Author:
- Lukas Zaruba, lukas.zaruba@lundegaard.eu, 2019
-
Method Summary
Modifier and Type Method Description GitWrapperaddRemote(java.lang.String remote)Adds remote named originGitWrapperclean()Deletes .git directory in given path removing traces that this was ever a git repositoryGitWrapperconfigureSparseCheckout(java.util.List<java.lang.String> paths)Configures repository to do sparse checkout populating configuration with given checkout pathsGitWrapperensureDirectory()Checks whether the pwd directory exists and creates if it doesn'tGitWrapperinitialize(java.nio.file.Path pwd)Initializes this wrapper with pwd.GitWrapperinitRepository()Initializes new git repository in given pathGitWrapperpull(java.lang.String branch)Performs git pull using origin remote and given branch
-
Method Details
-
initialize
Initializes this wrapper with pwd. This method must be called before any other interaction -
ensureDirectory
GitWrapper ensureDirectory()Checks whether the pwd directory exists and creates if it doesn't- Throws:
java.lang.IllegalStateException- if there already is a .git directory inside the pwd
-
initRepository
GitWrapper initRepository()Initializes new git repository in given path -
addRemote
Adds remote named origin -
configureSparseCheckout
Configures repository to do sparse checkout populating configuration with given checkout paths -
pull
Performs git pull using origin remote and given branch -
clean
GitWrapper clean()Deletes .git directory in given path removing traces that this was ever a git repository
-