https://github.com/rgl/uselibgit2sharp
example application uses the libgit2sharp library to create a local git repository, a commit, and a push to a remote repository
https://github.com/rgl/uselibgit2sharp
csharp example git libgit2 libgit2sharp
Last synced: 9 months ago
JSON representation
example application uses the libgit2sharp library to create a local git repository, a commit, and a push to a remote repository
- Host: GitHub
- URL: https://github.com/rgl/uselibgit2sharp
- Owner: rgl
- Created: 2021-06-12T08:04:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-06T08:11:06.000Z (over 2 years ago)
- Last Synced: 2025-02-06T11:56:55.439Z (11 months ago)
- Topics: csharp, example, git, libgit2, libgit2sharp
- Language: C#
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
[](https://github.com/rgl/UseLibgit2sharp/actions/workflows/build.yml)
This example application uses the [libgit2sharp library](https://github.com/libgit2/libgit2sharp) to create a local git repository, a commit, and a push to a remote repository.
## Usage (Ubuntu 22.04)
Install [docker](https://github.com/moby/moby) and [docker compose](https://github.com/docker/compose).
Build and start the local gitea git server:
```bash
docker compose down --remove-orphans --volumes
docker compose up --build
```
In another shell, build and execute the example application:
```bash
dotnet run # or: docker compose run --build test
```
List the local repository log:
```bash
git --git-dir tmp/test/.git log --oneline
```
Observe the remote repository:
http://localhost:3000/jane.doe/test
Destroy everything:
```bash
docker compose down --remove-orphans --volumes
```
## Reference
* [LibGit2Sharp Hitchhiker's Guide to Git](https://github.com/libgit2/libgit2sharp/wiki/LibGit2Sharp-Hitchhiker%27s-Guide-to-Git)