I am writing an application in Haskell that will have to perform basic operations on Git repositories (add, log, push, pull, fetch, diff etc.)
What are my options here (are there any apart from invoking shell commands from Haskell)? I could not find any good leads on Hackage.
libgit2 is used to power Git GUI clients like GitKraken and gmaster and on Git hosting providers like GitHub, GitLab and Azure DevOps.
git-sync is a simple command that pulls a git repository into a local directory. It is a perfect "sidecar" container in Kubernetes - it can periodically pull files down from a repository so that an application can consume them. git-sync can pull one time, or on a regular interval.
To create a new repo, you'll use the git init command. git init is a one-time command you use during the initial setup of a new repo. Executing this command will create a new . git subdirectory in your current working directory.
You shouldn't store credentials like usernames, passwords, API keys and API secrets. If someone else steals your credentials, they can do nasty things with it.
There are many good libraries for interacting with Git available on Hackage:
You should be able to get started with these packages.
Better than hlibgit2 is gitlib, which is a high-level set of type wrappers around the functionality of hlibgit2, designed for laziness, performance, and to suit a Haskell mindset.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With