libgit2sharp

LibGit2Sharp and Authentication UI

末鹿安然 提交于 2020-01-14 14:18:10
问题 I'm working with LibGit2Sharp to add a number of Git operations to an application. I've added the Microsoft.Alm.Authentication to help with Authentication and credential manager access. It works great for retrieving credentials that are already entered from the command line. However is there any way to also hook into the Credential Manager's Login UI that prompts for username and password for Github, BitBucket and VSTS. This UI pops up automatically from the command line, but doesn't fire

How to get files changed/removed/added using libgit2sharp?

喜夏-厌秋 提交于 2020-01-13 20:36:26
问题 I have two dates - from and to. I have to find the files changed in the repository between that date difference and make a list of it. Here is a related question which gets the differece between trees.Get files modified/added/removed from a commit in LibGit2Sharp. 回答1: So lets assume you are trying to replicate: git log --reverse --since "11/10/2015" --until="11/15/2015" --format="%cD %s" Once you have a list of commits, ICommitLog , via all the repo's Commits , a filtered branch list, etc..

Find out the branch a commit belongs to in LibGit2Sharp?

随声附和 提交于 2020-01-13 12:27:43
问题 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 branch it belongs to? Ideally I would like to have a pointer to the branch object, but even a name would be fine in this scenario. This is what the debugger shows up: This is what I am looking for: TortoiseGit's behavior of showing the most relevant

Find out the branch a commit belongs to in LibGit2Sharp?

此生再无相见时 提交于 2020-01-13 12:25:22
问题 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 branch it belongs to? Ideally I would like to have a pointer to the branch object, but even a name would be fine in this scenario. This is what the debugger shows up: This is what I am looking for: TortoiseGit's behavior of showing the most relevant

how to clone GitHub repo locally via libgit2sharp?

蓝咒 提交于 2020-01-06 19:27:05
问题 I wrote code to programmatically clone a GitHub private repo to a local repo via libgit2sharp ( v0.21.0.176 ) var cloneOptions = new CloneOptions { BranchName = "master", Checkout = true }; var cloneResult = Repository.Clone( @"https://github.com/my-organization/my-repo.git", @"c:\github\my-organization\my-repo" ); exception thrown : {LibGit2Sharp.LibGit2SharpException: Request failed with status code: 401 at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) at LibGit2Sharp.Core.Ensure

Libgit2Sharp: get files in all commits between two tags

被刻印的时光 ゝ 提交于 2020-01-06 02:55:06
问题 I can do this in GitBash: $ git diff --name-only v01...HEAD -- *.sql which gives: Components/1/Database/Stored Procedures/spDC1.sql Components/1/Database/Stored Procedures/spDC2.sql I can't see how I would do this in LibGit2Sharp. Any ideas? Thanks 回答1: Here is an example from one of my projects that get a ICommitLog collection between two commits (current HEAD vs. the master branch): // git log HEAD..master --reverse public ICommitLog StalkerList { get { var filter = new CommitFilter {

How do I build a version tree for a Git repository using LibGit2(Sharp)

江枫思渺然 提交于 2020-01-04 02:38:06
问题 Some background: I'm looking at the possibility of using Git as a data storage layer. Basically I need to keep all versions of some XML files which describe application state. The users needs a "Time Machine" to be able to revert to previous states, as well as branch off previous states etc. This will be hidden behind a service layer, but I am looking at using Git at the back end. I need to present the evolution of the application's state over time, so I want to build a network diagram

Does libgit2 support SSH-Transport-Protocol?

杀马特。学长 韩版系。学妹 提交于 2019-12-31 01:10:30
问题 Is it possible to clone a repository via ssh using ssh-keys? 回答1: SSH transport is not yet implemented in libgit2. Check issue 1103 issue 1558 for progress. Update Pull request 1508 has been merged on May, 16th 2013. Since then, it's also been well taken care of (cf. 1706 , 1717 , 1775 , 1851 , 1903 , 1904 ). It's even now continuously tested on Travis (cf. 1774 ). 来源: https://stackoverflow.com/questions/15204015/does-libgit2-support-ssh-transport-protocol

is libgit2 automatically packing repositories

∥☆過路亽.° 提交于 2019-12-24 19:09:15
问题 I did not see a garbage collection command in LibGit2 so I was wondering if it is currently automatically packing files in a local repository. 回答1: There is no automatic repacking. This is something which you absolutely never want the library to do. All objects start off as loose objects and remain that way until some tool decides it would like to do housekeeping. Repacking (and gc operations in general) is 90% policy, which is not something that the library should be doing. Whatever tool

LibGit2Sharp - The current branch is configured to merge with the reference '' from the remote, but this reference was not fetched

筅森魡賤 提交于 2019-12-24 15:39:03
问题 I'm using LibGit2Sharp and after cloning the repository and try to call the PULL command, always gives the same error. I've tried to use checkout, reset, merging and not changed. public void RecuperarRepositorio() { if (!Directory.Exists(DS_CAMINHO_DESTINO + @"\.git")) CriarRepositorio(); else AtualizarRepositorio(); } private void CriarRepositorio() { var path = Repository.Clone(DS_CAMINHO_GIT, DS_CAMINHO_DESTINO, RetornaCloneOptions()); } private void AtualizarRepositorio() { using (var