标签: libgit2sharp

如何使用libgit2连接到GitHub存储库?

我正在尝试连接到一个回购:

using(var Git = new Repository(
    Repository.Clone("https://github.com/wikimedia/mediawiki-core", "tmp")
)){
    foreach(var Commit in Git.Commits)
    {
        MessageBox.Show(Commit.Author.Name);
    }
}
Run Code Online (Sandbox Code Playgroud)

它连接正常(如果我更改了URL,我得到了预期的异常),但没有显示MessageBoxes - 为什么?这应该很简单.

c# git github libgit2 libgit2sharp

2
推荐指数
1
解决办法
3186
查看次数

我们如何在Visual Studion 2010 Windows应用程序中集成Libgit2库

我从这个站点下载了两个DLL(libgit2sharp.dllgit2.dll).

之后,我通过在.NET Windows应用程序中添加引用成功添加了Libgit2sharp.dll.现在,当我通过在.NET Windows应用程序中添加引用添加git2.dll时,它会出错:

a reference to 'C:\User\nitesh\git2.dll' could not be added please make sure that the file is accessible and that it is a valid assembly or COM component
Run Code Online (Sandbox Code Playgroud)

有人可以帮我理解这个问题吗?

libgit2 libgit2sharp

2
推荐指数
1
解决办法
1919
查看次数

以编程方式删除克隆存储库的目录

我正在使用LibGit2Sharp将远程存储库克隆到 Windows 临时文件夹中。我的脚本完成后,我想清理一下。但是,我总是收到以下错误:

系统错误:拒绝访问路径“pack-efcef325f8dc897099271fd0f3db6cf4d9f12393.idx”。

pack-efcef325f8dc897099271fd0f3db6cf4d9f12393.idx文件在哪里$local_git_clone_path\objects\pack.

如何完全删除我使用 LibGit2Sharp 克隆的 git repo 的所有本地剩余物?

c# git libgit2sharp

1
推荐指数
1
解决办法
1237
查看次数

创建本地分支以使用 libgit2sharp 跟踪远程分支

如何使用 libgit2sharp 创建跟踪远程分支的本地分支?git 等价物是:

git branch --track development origin/development
Run Code Online (Sandbox Code Playgroud)

libgit2sharp

1
推荐指数
1
解决办法
1890
查看次数

LibGit2Sharp:"太多重定向或身份验证重放"提取失败

这是我用来获取的代码:

public static void GitFetch()
{
    var creds = new UsernamePasswordCredentials()
                {Username = "user",
                 Password = "pass"};
    var fetchOpts = new FetchOptions {Credentials = creds};
    using (repo = new Repository(@"C:\project");)
    {
        repo.Network.Fetch(repo.Network.Remotes["origin"], fetchOpts);
    }
}
Run Code Online (Sandbox Code Playgroud)

但在获取期间失败并出现以下异常:

LibGit2Sharp.LibGit2SharpException: Too many redirects or authentication replays
Result StackTrace:  
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteSafeHandle remote, Signature signature, String logMessage)
   at LibGit2Sharp.Network.DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options, Signature signature, String logMessage)
   at LibGit2Sharp.Network.Fetch(Remote remote, FetchOptions options, Signature signature, String logMessage)
Run Code Online (Sandbox Code Playgroud)

我已经验证配置文件具有所需的远程名称,并且git fetch可以从命令行运行.我发现异常起源于libgit2\src\transport\winhttp.c但我无法提出解决方法/解决方案.

libgit2 libgit2sharp

1
推荐指数
1
解决办法
4964
查看次数

如何使用libgit2sharp推送标签

我需要使用libgit2sharp将本地存在的标签推送到远程。但是我找不到怎么做。

我在libgit2sharp的github仓库(问题和测试用例)中进行了大量搜索,但没有发现任何问题。

有一些关于替代方法的讨论git push --tags,人们说此命令只是git push <remote> refs/tags/*:refs/tags/*对它的一种语法糖,而这正是您需要在libgit2sharp中执行的操作才能使标签被推送。

但是我怎么翻译这个命令

git push <remote> refs/tags/*:refs/tags/*
Run Code Online (Sandbox Code Playgroud)

放入libgit2sharp代码?

谢谢你们。

c# libgit2sharp

1
推荐指数
1
解决办法
729
查看次数

使用 libgit2sharp 检出远程分支

考虑以下,我在 github 上有两个分支:master 和 dev。我有一个本地存储库,它是一个克隆并指向远程 master,但我想将它切换到 dev 分支,以便我所做的任何更改都将提交给 dev 而不是 master。需要采取哪些步骤才能做到这一点?我尝试了多种方法,但它们似乎从未奏效,并且始终致力于掌握。请简单解释一下,因为我还是 Git 和 libgit2sharp 的新手,所以我仍在努力解决它。

编辑:我使用 libgit2sharp 库来发出 git 命令,而不是 Git shell

git commit github libgit2sharp

0
推荐指数
1
解决办法
2525
查看次数

标签 统计

libgit2sharp ×7

c# ×3

git ×3

libgit2 ×3

github ×2

commit ×1