Questions tagged [ngit]

NGit is a semi-automated port of JGit for .NET and mono

NGit is a semi-automated port of JGit for .NET and mono.

It is periodically synchronized with JGit using Sharpen with the aid of some patches to the original Java code and generated C# code.

It is maintained by the Mono team.

Its source is available at GitHub, and it can be imported into your Visual Studio project via NuGet.

22 questions
19
votes
4 answers

GitSharp vs NGit

What is the current state of GitSharp and NGit and which one is better suited for Git automation from .NET?
serega
  • 564
  • 1
  • 5
  • 14
5
votes
1 answer

Unable to stop tracking JetBrains .idea files

I have added the .idea files to my .gitignore file and that seems to work fine. Since my .idea files were tracked already, though, earlier posts have suggested the following code, to get them out from under version control. git rm -rf .idea or git…
Mike McGuire
  • 329
  • 3
  • 12
5
votes
1 answer

NGit making a connection with a private key file

I am trying to use NGit to connect to Github (ie using a private key as well as a password). Can someone walk me through it? My normal fetch would be: var git = Git.CloneRepository() .SetDirectory(_properties.OutputPath) …
Doug
  • 6,460
  • 5
  • 59
  • 83
2
votes
1 answer

Get commit count of a sub folder in a repo

Im using NGit with C# to get data from our repo I'm trying to figure out how to get the commit count of a sub folder in a repo from the current branch. Something like (but with subfolder support) git rev-list --count HEAD edit: This works but it…
Anders
  • 17,306
  • 10
  • 76
  • 144
1
vote
1 answer

C#: Get the sha1 of the last commit in git repo?

I'm trying to create somewhat of a version tag with branch:sha1. I've managed to get the branch name, but I can't get the last commits sha1? It should be fairly similar to JGit for Java as its a port of it, but I can't see any way the API is…
nyxusaha
  • 49
  • 6
1
vote
0 answers

"JGitInternalException: username is not given" generated from NGit when trying to clone via SSH form Git repository hosted on TFS on-premise

I am using NGit api to connect to git repositories and manipulate them. I have a case where I want to connect to my git repository hosted on TFS on premise. I create ssh key, insert it inside repository everything goes well. But when I want to clone…
kokoshaner
  • 64
  • 10
1
vote
1 answer

NGit (JGit port) authentication with SSH on C#

I'm tyring to setup Git functionality in my application with NGit. The repository is an SSH authenticated one on BitBucket, that I am unable to authenticate for Git functionality like Push, Pull, Clone etc. My code is as…
PhoenixDev
  • 746
  • 2
  • 9
  • 22
1
vote
1 answer

Clone repository into existing directory using NGit / JGit

I'm trying to clone a GitHub repository into a existing, non-empty directory. I tried mimicking the way it's done using the git command line: git init git remote add origin https://github.com/[...].git git fetch git reset --hard origin/branch var…
copygirl
  • 61
  • 8
1
vote
2 answers

What is the method in NGit to see if remote repo changed?

I am trying to use IsClean() from NGit to determine if any changes have been detected in the working copy, it works fine but when I try to see if anything changed in remote I don't think IsClean() is the proper method to try. So I wanted to know if…
solti
  • 4,339
  • 3
  • 31
  • 51
1
vote
1 answer

Removing a cloned repo

I'd like to remove a cloned repo on disk using NGit, which is a port of JGit. I've previously done this to clone a remote repo locally: System.IO.Directory.CreateDirectory(someDir); var clone =…
p.campbell
  • 98,673
  • 67
  • 256
  • 322
1
vote
0 answers

How to cherry-pick a commit that has more than one parent?

I am writing an application that automates the re-building of a branch based on a new head. It uses cherry-picking to get the job done, but many times the app runs into merge commits that have 2 parents. When I…
Byron Sommardahl
  • 12,743
  • 15
  • 74
  • 131
1
vote
1 answer

Exception / hang on Mono.Security Diffie-Hellman key generation for SSH Transport

I'm trying to do pushes through SSH on NGit. I am specifying my own keys by using the method set out here: NGit making a connection with a private key file It works well with a clone, and on the first push. After that, it fails 30% of the time,…
user1713993
  • 113
  • 2
  • 7
1
vote
1 answer

NGIT/JGIT/Git# SSH Session with private key to Clone GiT repository

The session part connections with the private key, no problem. However when I do a git Clone, it gives the error 'Auth Fail'. How do I wrap, bind or make the connected session work with git clone. I'm using NGIT under .NET 4.0, but don't think this…
Gavin
  • 29
  • 3
1
vote
0 answers

Fixing a merge conflict in NGit with theirs?

I've been looking around and there's not a lot of clear examples as to how to resolve this. I found this example on stack for JGit, but it doesn't appear to be working for NGIT. I've done: var merge =…
toofarsideways
  • 3,956
  • 2
  • 31
  • 51
0
votes
2 answers

How to respond to git clone command using NGIT

Using NGit (or even JGit since it's a port) does anyone know how to respond to the Git clone command over Smart HTTP? What would the sample code look like? I can't find any references or documentation which describes this. I'm trying to create a…
Fixer
  • 5,985
  • 8
  • 40
  • 58
1
2