libgit2sharp

Visual Studio Extensibility: Get the Git repository's path from Team Explorer's Git Commit Details page

冷暖自知 提交于 2021-02-07 19:29:59
问题 I am adding Git integration to my Visual Studio extension Diff All Files, which allows for quickly diffing (i.e. comparing) all files in the Team Explorer window with a previous version. I have it working with the Git Changes page (in Team Explorer), since when I get the Microsoft.TeamFoundation.Git.Controls.Extensibility.IChangesExt service the files in it's IncludedChanges property contain the full file path on disk. However, when working with the Git Commit Details page I get the Microsoft

Visual Studio Extensibility: Get the Git repository's path from Team Explorer's Git Commit Details page

给你一囗甜甜゛ 提交于 2021-02-07 19:29:24
问题 I am adding Git integration to my Visual Studio extension Diff All Files, which allows for quickly diffing (i.e. comparing) all files in the Team Explorer window with a previous version. I have it working with the Git Changes page (in Team Explorer), since when I get the Microsoft.TeamFoundation.Git.Controls.Extensibility.IChangesExt service the files in it's IncludedChanges property contain the full file path on disk. However, when working with the Git Commit Details page I get the Microsoft

Exception reading manifest from file. Microsoft Word Add-in VSTO

亡梦爱人 提交于 2021-01-28 03:31:09
问题 I am trying to create a Microsoft Word add-in that will add and commit to a git repo every time the Word document is saved, either auto save or manual save. I have been able to get the functionality I desire when I run the program from within Visual Studio (debug mode). When I publish and install the add-in so that it runs when Word starts, I get the following error. Now when I try to add the LibGit2Sharp NuGet packages, running in debug mode from within Visual Studio gives me this error: and

Bitbucket authentication to use LibGit2Sharp

自闭症网瘾萝莉.ら 提交于 2021-01-27 18:35:22
问题 I used the CSharp.Bitbucket library to authenticate users with Bitbucket (https://github.com/scottksmith95/CSharp.Bitbucket). The authentication works fine, I get the token value and token secret values. I have alredy written a logic - with the help of LibGit2Sharp (https://github.com/libgit2/libgit2sharp) - to clone/pull/push the content of the users repo. It works fine if the user authenticates with GitHub. In that case I have to provide the value of the access token for username and an

LibGitSharp: Checkout Remote Branch

╄→гoц情女王★ 提交于 2020-08-24 07:27:09
问题 i try to Checkout a Remotebranch via LibGitSharp. In git itself you use this comands: git fetch origin git checkout -b test origin/test in newer Versions it is just: git fetch git checkout test So i tried this Code: repo.Fetch("origin"); repo.Checkout("origin/" + Name); The Fetch and Checkout runs without any problems but there is no copy of the Remotebranch. Does anyone have an idea to Checkout the Remote with other methods? My alternative would be to create the Branch in the Repository and

LibGitSharp: Checkout Remote Branch

寵の児 提交于 2020-08-24 07:25:24
问题 i try to Checkout a Remotebranch via LibGitSharp. In git itself you use this comands: git fetch origin git checkout -b test origin/test in newer Versions it is just: git fetch git checkout test So i tried this Code: repo.Fetch("origin"); repo.Checkout("origin/" + Name); The Fetch and Checkout runs without any problems but there is no copy of the Remotebranch. Does anyone have an idea to Checkout the Remote with other methods? My alternative would be to create the Branch in the Repository and

How to get the current/active branch with LibGit2Sharp?

▼魔方 西西 提交于 2020-06-25 07:32:31
问题 So using LibGit2Sharp https://github.com/libgit2/libgit2sharp you can walk through the branches like this using (var repo = new Repository(@"path to .git")) { foreach (var branch in repo.Branches) { Debug.WriteLine(branch.Name); } } But how do I get the current/active branch? 回答1: Branch.IsCurrentRepositoryHead should do the trick. I think Repository.Head will also do the same thing if you don't want to iterate through the branches... 回答2: I think that, instead of going through the branches

How to get the current/active branch with LibGit2Sharp?

百般思念 提交于 2020-06-25 07:32:11
问题 So using LibGit2Sharp https://github.com/libgit2/libgit2sharp you can walk through the branches like this using (var repo = new Repository(@"path to .git")) { foreach (var branch in repo.Branches) { Debug.WriteLine(branch.Name); } } But how do I get the current/active branch? 回答1: Branch.IsCurrentRepositoryHead should do the trick. I think Repository.Head will also do the same thing if you don't want to iterate through the branches... 回答2: I think that, instead of going through the branches

What is the LibGit2Sharp equivalent of 'git pull'?

冷暖自知 提交于 2020-02-23 09:26:52
问题 I'm trying to merge changes from the remote branch into the local repository, however I've been unable to get this to work properly -- likely misunderstanding of the implementation. Fetching seems to work fine, as I can see the updates on the server, but I think I'm breaking something when attempting to pull. I've tried: repo.Checkout( branch.TrackedBranch, CheckoutOptions.None, OnCheckoutProgress ); This seems to do what you would expect from a Clone call. I can also not find a method to

How do you authenticate to VSTS using LibGit2Sharp?

天大地大妈咪最大 提交于 2020-01-14 14:26:05
问题 I'm trying to clone a VSTS (Visual Studio Team Services) repository using LibGit2Sharp. I'm setting up a CredentialsHandler and UsernamePasswordCredentials representing my Microsoft Account's credentials, and the result I get is this: LibGit2Sharp.LibGit2SharpException was unhandled HResult=-2146233088 Message=Too many redirects or authentication replays Source=LibGit2Sharp If I can't even pass in my actual username and password, I'm not sure what might work. I also tried using