Questions tagged [libgit2sharp]

.NET and Mono open source bindings for libgit2, a native Git library

LibGit2Sharp is an thin .NET/Mono layer wrapping the libgit2 linkable C Git library.

It provides a very opiniated API which should be very easy to use and discover.

Online resources

503 questions
6
votes
6 answers

Using libgit2sharp with LINQPad?

I have the LINQPad version with NuGet and I add libgit2sharp but this relies on a another (native) dll. I've tried: Copying them my systemdirectory. Put them in a separate directory that I've added to the path. Put them in LINQPads plugin…
Don
  • 9,511
  • 4
  • 26
  • 25
5
votes
3 answers

Find out the branch a commit belongs to in LibGit2Sharp?

I am looping through commits in LibGit2Sharp: Repository repo = new Repository("Z:/www/gg"); foreach (LibGit2Sharp.Commit commit in repo.Commits) { ... } I can retrieve properties like Author and Message, but I do not see anything about what…
Tower
  • 98,741
  • 129
  • 357
  • 507
5
votes
2 answers

How to obtain number of commits behind/ahead with libgit2sharp?

It's possible to obtain the number of commits behind/ahead using git rev-list command. I am trying to achieve the same thing using libgit2sharp library but the library is not fully documented so I couldn't find how to. I'm looking for an example for…
Ferit
  • 8,692
  • 8
  • 34
  • 59
5
votes
1 answer

Git network operations behind corporate firewall using LibGit2Sharp throws

I am trying to use LibGit2Sharp to git push origin using the following using(var repo = new Repository("path\to\repo\.git")) { var commit = repo.Commit("Commit message", author, committer); var options = new PushOptions{ CredentialsProvider…
aateeque
  • 2,161
  • 5
  • 23
  • 35
5
votes
1 answer

LibGit2Sharp how to resolve a conflict?

Using libgit2sharp I am merging changes from two users: public void Merge(string branchName) { using (Repository repo = new Repository(this._settings.Directory)) { var branch = repo.Branches[branchName]; MergeOptions opts =…
Pavel Korsukov
  • 939
  • 11
  • 20
5
votes
4 answers

LibGit2Sharp: Fetching fails with "Too many redirects or authentication replays"

Here's the code I'm using to fetch: public static void GitFetch() { var creds = new UsernamePasswordCredentials() {Username = "user", Password = "pass"}; var fetchOpts = new FetchOptions {Credentials =…
Rovin Bhandari
  • 445
  • 1
  • 4
  • 12
5
votes
3 answers

How to do 'git add *' with libgit2sharp?

I have an external process that applies changes to files part of a local Git repository initially cloned through libgit2sharp. I would like to perform - through libgit2sharp - the equivalent of the command git add *, followed by git commit -m "Hello…
Joannes Vermorel
  • 8,976
  • 12
  • 64
  • 104
5
votes
1 answer

Pushing to bitbucket with libgit2sharp

I'm trying to use libgit2sharp to push to my repo on bitbucket. I'm trying to do this: repo.Network.Push(repo.Branches[branchName], pushOptions); Everything seems fine, no exceptions are thrown and I get no errors in the callback, but when I check…
user3236635
  • 53
  • 1
  • 5
5
votes
1 answer

How to commit to a bare repository?

I'm writing a git wrapper for fuse (linux) to access git repositories like normal files and directories. Accessing folders and files for branches, tags and commits works quite well but I get a strange behaviour when I commit files. I do the…
Daniele Salvatore Albano
  • 1,263
  • 2
  • 13
  • 29
5
votes
1 answer

Orphan branch in libgit2sharp

How do you create an orphan branch in libgit2sharp? All i could find are methods which create a branch which points to a commit. I'm looking for an effect similar to the command: git checkout --orphan BRANCH_NAME
SWilly22
  • 869
  • 4
  • 5
5
votes
1 answer

How do I get a previous version of a file with libgit2sharp

I'm trying to use libgit2sharp to get a previous version of a file. I would prefer the working directory to remain as is, at the very least restored to previous condition. My initial approach was to try to stash, checkout path on the file I want,…
Shlomo
  • 14,102
  • 3
  • 28
  • 43
5
votes
1 answer

Equivalent to git difftool -y with libgit2sharp?

I am planning to replace the usage of git.exe from windows path by libgit2sharp for my plugin GitDiffMargin, A Visual Studio 2012 extension to display Git Diff on the margin of the current file. - https://github.com/laurentkempe/GitDiffMargin I…
Laurent Kempé
  • 751
  • 9
  • 21
5
votes
1 answer

Does libgit2 support SSH-Transport-Protocol?

Is it possible to clone a repository via ssh using ssh-keys?
zpete
  • 1,725
  • 2
  • 18
  • 31
5
votes
1 answer

Problems loading git2.dll?

Im trying to use the libgit2sharp library. My only code is Repository repository = new Repository(@"C:\Path\To\Repo"); and when i run it i get an error saying Unable to load DLL 'git2': The specified module could not be found. So, I manually went…
Whyrusleeping
  • 889
  • 2
  • 9
  • 20
4
votes
0 answers

LibGit2Sharp-SSH "Failed to start SSH session: Unable to exchange encryption keys"

I'm using the current version of LibGit2Sharp-SSH from https://github.com/leobuskin/libgit2sharp-ssh I generated a SSH private and public key using OpenSSH. I set up an OpenSSH Server, and am able to use Git Bash to Clone/Push etc. using SSH. I'm…
Garrick
  • 71
  • 2