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
7
votes
1 answer

What is equivalent of git checkout branch_name on LibGit2Sharp

I have 2 branches in git server which are master and develop. I clone the repository to my machine using the code below. var options = new CloneOptions() { CredentialsProvider = this.credentialsHandler, }; return …
Anonymous
  • 9,366
  • 22
  • 83
  • 133
7
votes
1 answer

Storing credentials for automated use

I've already looked around, and since i'm no security or encryption expert, I am still confused on how to implement encryption in my program. I need a server to login to its gitHub account to update code files with special headers. The only…
maliddle
  • 148
  • 8
7
votes
2 answers

How to configure libgit2 in TFS Build with private repositories?

I am currently using TFS 2013 (local installation) to try to build from an internal GitHub Enterprise installation using LDAP Authentication. The problem I am getting is that it cannot access the source code, how can I configure TFS Build to use a…
Tom Anderson
  • 10,807
  • 3
  • 46
  • 63
7
votes
2 answers

How to find all commits having a particular parent?

How may I find all commits in a repository that have a specific parent? For example, if I have a commit A, I would like to find all other commits that share the parent with A. What would be the most effective, i.e. performant yet correct way to do…
Tower
  • 98,741
  • 129
  • 357
  • 507
6
votes
1 answer

How can I get file binary data out of Git repository using LibGit2Sharp?

I have decided to try and migrate my project from using GitSharp to LibGit2Sharp since GitSharp is no longer actively maintained. With GitSharp I was able to access the raw bytes of any file checked into my repo given a branch. I cannot locate any…
Nick
  • 19,198
  • 51
  • 185
  • 312
6
votes
1 answer

How can I get the last commit for a folder using LibGit2Sharp?

I've got a large number of projects all in a single repository. I want to determine the volatility of all of these projects, i.e., when there was last a commit that affected each project. I've got a list of all of the project paths, and I'm trying…
Chris B. Behrens
  • 6,255
  • 8
  • 45
  • 71
6
votes
2 answers

Download one file from remote (git show) using libgit2sharp

Using git show, I can fetch the contents of a particular file from a particular commit, without changing the state of my local clone: $ git show $ git show : How can I achieve this programatically using libgit2sharp?
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
6
votes
1 answer

How to pull latest from a specific remote branch without having need to provide user details?

Requirement: Using libgit2sharp I want to pull (fetch + merge) latest from a specific git remote branch to my currently checked out local branch, without having to pass any other argument, like user credentials etc. Basically I am trying to…
nawfal
  • 70,104
  • 56
  • 326
  • 368
6
votes
3 answers

Git stash on windows extremly slow compared to Libgit2

Recently I've been using git stash many times and I've been thinking that it is really slow, even on a new repository with a single file. I've read this question about git stash slowness and this other one and tried every answer to these questions…
Abdelilah El Aissaoui
  • 4,204
  • 2
  • 27
  • 47
6
votes
1 answer

Timeout error cloning Git repository using LibGit2Sharp

My organization runs its own GitHub server and web proxies. I have configured git so that I can work with both github.com and our internal GitHub from the command line. But using LibGit2Sharp, I cannot perform operations against our GitHub server.…
Michael Gunter
  • 12,528
  • 1
  • 24
  • 58
6
votes
2 answers

Error encountered while cloning the remote repository with VS 2015 Update 3 (TFS 2015 Update 3)

I have recently upgraded to VS 2015 (Update 3) on the client side and TFS 2015 (Update 3) on server side. The Git operations worked for a while, then I started getting following error when trying to clone a git repo: Error encountered while cloning…
Raghu
  • 2,859
  • 4
  • 33
  • 65
6
votes
2 answers

libgit2sharp remove remote branch

I want to delete a branch locally and remote. My code: using (var repository = new Repository(path)) { var remote = repository.Network.Remotes["origin"]; var options = new PushOptions(); var credentials = options.CredentialsProvider =…
Sergiu
  • 297
  • 3
  • 16
6
votes
1 answer

LibGit2Sharp Find what files were updated/added/deleted after pull

After running a repo.Network.Pull() command I want to be able to see what files were added to the repository, altered in the repository and removed from the repository. All I need is the file path of the file and if it was an add/update or a…
Nived
  • 1,804
  • 1
  • 15
  • 29
6
votes
1 answer

How to use the new CredentialsProvider in LibGit2Sharp?

I using the LibGit2Sharp.Credentials class for some time at the following way: LibGit2Sharp.Credentials credentials = new UsernamePasswordCredentials() { Username = TokenValue, Password = "" }; var pushOptions = new PushOptions() {…
Gábor Domonkos
  • 1,081
  • 1
  • 17
  • 33
6
votes
1 answer

C# How to read commit time with libgit2Sharp

I am trying to list all commits in repository, their Authors and date of commit using libgit2Sharp, but the commit object doesn't have property of date/time where the commit was created. using (var repo = new Repository(path)) { ///get…
urza.cc
  • 223
  • 1
  • 8
1 2
3
33 34