libgit2sharp

Failed To set Proxy: Wrong parameter libgit2sharp

老子叫甜甜 提交于 2019-12-13 07:02:37
问题 I'm having some problems when I try to clone a repository using the library libgit2sharp. I'm getting this error: A first chance exception of type 'LibGit2Sharp.LibGit2SharpException' occurred in LibGit2Sharp.dll Additional information: Failed to set proxy: Wrong parameter. I'm trying to clone like this: var gitServerUri = new Uri(Settings.Default.GitServerUrl); var cred = Git.Credentials.Get(gitServerUri.Host); string clonedRepoPath = Repository.Clone(project.GitUrl(),projectLocalPath, new

not able to run LibGit2Sharp on Mono on ubuntu

对着背影说爱祢 提交于 2019-12-13 05:37:16
问题 have a very simple one line console app (using monodevelop) but getting below error. System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: git2-e0902fb my app has reference two nuget package LibGit2Sharp 0.21.0.176 LibGit2Sharp.NativeBinaries 1.0.119 LibGit2Sharp.Repository.Init("foler path"); 回答1: libGit2Sharp 0.21.0.176 nuget does have dependency on a specific native library and it requires

How to use Libgit2Sharp on Mono/MacOsX?

白昼怎懂夜的黑 提交于 2019-12-13 03:43:34
问题 I am using Xamarin Studio 5.7 with Mono 3.12 on OSX 10.9.5. Using NuGet I downloaded the libgit2sharp library. I am able to use the classes when writing the code, there are no compiler errors. However at run time I get the following error: Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for LibGit2Sharp.Core.NativeMethods ---> System.DllNotFoundException: git2-91fa31f at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git

libgit2sharp: replace the "git pull” command

末鹿安然 提交于 2019-12-13 02:25:26
问题 I want to use labgit2sharp to replace the command -- "git pull“ to pull my code from my gitlab. but it is not successful by using the following code: using (var repo = new Repository(remotePath)) { LibGit2Sharp.PullOptions options = new LibGit2Sharp.PullOptions(); options.FetchOptions = new FetchOptions(); options.FetchOptions.CredentialsProvider = new CredentialsHandler( (url, usernameFromUrl, types) => new UsernamePasswordCredentials() { Username = "username", Password = "password" }); repo

Show conflicts when pulling using libgit2sharp

a 夏天 提交于 2019-12-13 00:25:17
问题 I'm using libgit2sharp to pull ( Commands.Pull ) from a remote repo using the default FetchOptions , MergeOptions and PullOptions . My working directory has an uncommitted change that will cause a conflict, and as expected I get a CheckOutConflictException with the message "1 conflict prevents checkout". What I can't figure out is how to programmatically find out the file that is causing the conflict. repo.Index.Conflicts doesn't contain any conflicts, I haven't found any documentation for

Can libgit2sharp rely on the installed git global configuration provider?

拟墨画扇 提交于 2019-12-12 21:31:30
问题 I'm wiring up some LibGit2Sharp code to VSO, so I need to use alternate credentials to access it. (NTLM won't work) I don't want to have to manage these cleartext credentials - I'm already using git-credential-winstore to manage them, and I'm happy logging onto the box if I ever need to update those creds. I see that I can pass in DefaultCredentials and UsernamePassword credentials - is there any way I can get it to fetch the creds from the global git cred store that's already configured on

How to exclude stashes while querying refs?

和自甴很熟 提交于 2019-12-12 20:04:18
问题 I'm trying to query for commits: repo.Commits.QueryBy(new LibGit2Sharp.Filter { Since = repo.Refs }).Take(100) This is otherwise ok, but it also returns stashes. How can I exclude stashes? I know that when I'm looping through the results I could just ignore them I guess, but then I wouldn't have 100 of them as I wanted. 回答1: The Since and Until properties of the Filter type are quite tolerant regarding what they can be valued with. According to the documentation they Can either be a string

How to detect what commit a branch has been created from in LibGit2Sharp

拜拜、爱过 提交于 2019-12-12 15:26:53
问题 So given an instance of LibGit2Sharp Branch how do you work out what commit that it was initially created from? 回答1: A Branch is merely an object depicting a git head reference. A head is a text file, mostly living under the .git/refs/heads hierarchy. This text file contains the hash of the commit this head currently points to. Similarly, a Branch bears a Tip property which points to a Commit . When working with git repositories and performing actions such as committing, resetting, rebasing..

Download one file from remote (git show) using libgit2sharp

本小妞迷上赌 提交于 2019-12-12 10:44:11
问题 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 <file> $ git show <commit>:<file> How can I achieve this programatically using libgit2sharp? 回答1: According to the documentation: $ git show 807736c691865a8f03c6f433d90db16d2ac7a005:a.txt Is equivalent to the code below: using System; using System.IO; using System.Linq; using System.Text; using LibGit2Sharp; namespace ConsoleApp2 { class Program {

Storing credentials for automated use

旧街凉风 提交于 2019-12-12 10:43:25
问题 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 hang-up I have right now is how to store/retrieve the server's credentials. PushOptions push = new PushOptions { Credentials = new UsernamePasswordCredentials { Password = "password", Username = "Username" } }; How would I encrypt these credentials for