Swiftpack.co - klein-artur/GitCaller as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by klein-artur.
klein-artur/GitCaller v_1.0.5
A wrapper around git.
⭐️ 0
🕓 6 weeks ago
.package(url: "https://github.com/klein-artur/GitCaller.git", from: "v_1.0.5")


This is a swift package currently in development. It is meant as a git bridge for swift, using git through shell, returning the result. Do not consider this as done.

I try to release stable versions via the main branch, but it can be way behind the current state of development. So feel free to use the develop branch which will always have the newest state (but also issues and unclean states).

It is used by the project Jagu.

Integration as a Swift Package.

Integrate it using the url of this package shown in the browser.

How it works.

The idea is to have a nice api to run git commands For example:

  • git init will be Git().init
  • git clone url will be Git().clone(url: "[email protected]:klein-artur/GitParser.git")
  • git add -a will be Git().add.all()
  • git add filename will be Git().add.path("filename")

To get the command as string, call Git().init.getString().

To run the command you have two possibilities:

  • Git().init.run() will return a Combine Publisher emitting the output. If multiple outputs happen the current output will be emitted.
  • Git().init.runAsync() will return a async function you can await to get the final output.

Parsed Results

This lib will also give you complete objects holding data.

There is a protocol Repository. The default implementation is GitRepo

This repo implementation already has a few methods to get parsed objects. For example:

GitRepo.standard.clone(url: String) will clone a repo from the given URL. GitRepo.standard.log(branchName: String) will give you a LogResult holding commits, plus information how to draw a git path.

And more.

Woha!!! Slow Slow!

As this is under development at the moment just a few commands and parameters are supported. Feel free to add more by a PullRequest.


Stars: 0
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Alpha 0.1.7
6 weeks ago

Fixed an issue in parsing status when in rebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics