Git4s is a pure functional wrapper around the git command line.
It provides a set of methods to interact with a git.
You can create a Git4s instance using the apply
method.
Logging is done using the CmdLogger
type class implicitly passed to each method. You can provide your own implementation of CmdLogger
to log the command output as you like, or use the default one provided by the library. By default, the library uses the Noop
logger which doesn't log anything since usually these logs are useful just for debugging purpose.
Example:
import cats.effect.IO
import com.geirolz.git4s.Git4s
import com.geirolz.git4s.data.GitVersion
import com.geirolz.git4s.log.*
given logger: CmdLogger[IO] = CmdLogger.console[IO](LogFilter.all)
val result: IO[GitVersion] = Git4s[IO].version
Type parameters
- F
-
the effect type
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Value members
Abstract methods
Clone a repository into a new directory.
Clone a repository into a new directory.
This method is not under Git4sRepository because it's not related to a specific repository.
Attributes
Get a type to access Git global config
Get a type to access Git global config
Attributes
Get the version of the installed git
Get a type to access Git local config
Get a type to access Git local config
Attributes
Instruct Git4s to use the current working directory.
Instruct Git4s to use the current working directory.
Attributes
Set the working directory for the Git4s instance.
Set the working directory for the Git4s instance.
Attributes
Get the current working directory if set.
Get the current working directory if set.
None
means current director.
Attributes
Concrete methods
Set the working directory for the Git4s instance.
Set the working directory for the Git4s instance.
Attributes
Inherited methods
Add file contents to the index.
Add file contents to the index.
Interactive commands not supported yet.
Attributes
- Inherited from:
- Git4sRepository
Select the branch with the specified name
Remove untracked files from the working tree.
Record changes to the repository.
Show the current branch.
Delete a branch.
Delete a branch on the remote.
Show changes between commits, commit and working tree, etc
Show changes between commits, commit and working tree, etc
Attributes
- Inherited from:
- Git4sRepository
Download objects and refs from another repository.
Create an empty Git repository or reinitialize an existing one.
Create an empty Git repository or reinitialize an existing one.
Attributes
- Inherited from:
- Git4sRepository
Install git
Install git if it's not already installed
Check if git is installed
Fetch from and integrate with another repository or a local branch.
Fetch from and integrate with another repository or a local branch.
Attributes
- Inherited from:
- Git4sRepository
Update remote refs along with associated objects.
Uninstall git and then install it again
Return a Git4sReset type to perform resets
Show the working tree status.
Uninstall git
Get the installed git version