libgit2

Error encountered while cloning the remote repository with VS 2015 Update 3 (TFS 2015 Update 3)

旧巷老猫 提交于 2019-12-07 04:05:37
问题 I have recently upgraded to VS 2015 (Update 3) on the client side and TFS 2015 (Update 3) on server side. The Git operations worked for a while, then I started getting following error when trying to clone a git repo: Error encountered while cloning the remote repository: An error occurred while sending the request. Inner Exception: The remote server returned an error: (401) Unauthorized. Inner Exception: No credentials are available in the security package But I can navigate to repo in the

How to push (with libgit2)

◇◆丶佛笑我妖孽 提交于 2019-12-07 03:47:56
问题 How do I do a push with libgit2? (Like git push origin master on console) I want to use the C version. Cloning, opening, adding files to index and committing work like a charm (see code). The test-bare-repository is local. Unfortunately, reference and documentation did not help me. Examples are very rare and mostly outdated (like this, the git_push_new() function seems to be gone). I'm guessing for some hours now and I think I tried all meaningfull combinations of code snippets from reference

Is it possible to add parts of a file to Git index using libgit2?

99封情书 提交于 2019-12-06 16:24:20
I am using libgit2, actually libgit2sharp, is there a way to add parts of a file similar to what add -p in CLI? I don't find anything from the documentation: http://libgit2.github.com/libgit2/#HEAD/group/index This is neither implemented (yet) in libgit2 , nor in LibGit2Sharp . In order to make this happen sooner rather than later, I'd suggest you to open a feature request in the libgit2 tracker . 来源: https://stackoverflow.com/questions/9597663/is-it-possible-to-add-parts-of-a-file-to-git-index-using-libgit2

git2go with libssl and libssh2 in single binary

自作多情 提交于 2019-12-06 11:04:30
Could anyone offer some suggestions (or resources) on how I could package a GO program that uses git2go, libssl and libssh2 such that it doesn't require the end user to install these libraries separately? I am only targeting Linux distros (if it matters) One way would be to build those dependencies statically as well and use PKG_CONFIG_PATH point to your own copies so everything gets linked statically. That should make CMake choose the static versions. But if the goal is to avoid depending on the user-installed libraries rather than making everything a single executable, I would recommend

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

陌路散爱 提交于 2019-12-06 04:28:17
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 . 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.. you can filter via Linq. So create your commit list: var repo = new Repository ("/Users/sushi/code

How to clone/fetch a git repository with libgit2?

元气小坏坏 提交于 2019-12-05 23:50:11
I need to initialize a git repository and fetch the latest version of a branch into it. In bash, the commands are: git init git remote add -t $BRANCH -f origin $REMOTE I'm trying to do the same programmatically with libgit2, but am having trouble finding the equivalent for the second line. The calls to create a remote are apparent, but I'm not seeing any to add it to a repository or handle the branch. Is it possible to do this with libgit2? If not, is there a library capable of doing this? High level steps describing how to implement a fetching process in libgit2 can be found here . You can

comparing 2 commits in rugged

删除回忆录丶 提交于 2019-12-05 18:31:37
I didn't find any documentation on getting the difference between 2 files in rugged. I used the below code to commit a file using rugged @repo=Rugged::Repository.new($reponame) @sha=@repo.write('D:\Ruby\MyGitRepo\file1.txt','blob') puts @sha commit = @repo.lookup(@sha) how can see the difference between the 2 commits of the same object in rugged? The way to compare two commits in git relies on a diffing process. brianmario recently wrapped the diffing iterator feature of libgit2 . Beware that this feature is not merged yet . Below a high level example of its future usage. r = Rugged:

Find out the branch a commit belongs to in LibGit2Sharp?

半城伤御伤魂 提交于 2019-12-05 16:43:56
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 branch name: Example repository: https://docs.google.com/open?id=0B-3

How to get the diff of a single file with libgit2?

荒凉一梦 提交于 2019-12-05 10:40:41
Is there a function equivalent to git diff FILE in libgit2 ? In other words, how to efficiently retrieve the diff of a single file without having libgit2 to look at other files in the working directory? git diff FILE will display the changes you've made relative to the index. This can be achieved through the use of the libgit2 git_diff_index_to_workdir() function. This function accepts a git_diff_options structure as a parameter into which you can provide a pathspec, or a list of pathspecs, you're specifically interested in. More information about this: Documentation of this function. Unit

Windows 下 gcc + golang 编译 git2go

血红的双手。 提交于 2019-12-05 10:22:08
最近研究用go语言操作git,除了直接走命令行用 os/exec 包,还可以使用 libgit2 的go绑定 git2go 操作。 但是 libgit2 是c语言库,go使用 cgo 连接c程序,需要 cgo 的支持。总之过程复杂,摔了一路。<!--more--> 安装 gcc 和 pkg-config 首先是安装 gcc 和 pkg-config (cgo依赖)。gcc编译器推荐用 TDM-GCC 来直接安装,方便快捷,注意不要用绿色版用安装版。 pkg-config 可以再gnome的 官方库 中找到。 pkg-config 安装需要同时下载: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip 把几个zip包中bin目录的所有exe和dll拷贝到gcc的bin目录。 gcc 编译 libgit2 libgit2