libgit2

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

How to use libgit2 from a native C++ application on Windows? (Microsoft VC++)

坚强是说给别人听的谎言 提交于 2019-12-29 09:57:28
问题 Summary: Is there any tiny example on how to build the Win32 C++ console application that uses the libgit2 library (sources available at GitHub)? I have followed the readme and the wiki on how to build the library on Windows using the CMake, and it worked smoothly (only a single unit-test error). Now, I want to build a simple console application that uses the library -- using Microsoft Visual Studio C++ 2010 ( the.vcxproj and the.sln ). I have found the general.c code in the libgit2 examples,

how to clone specific tag using git_clone() in libgit2

半城伤御伤魂 提交于 2019-12-25 11:49:48
问题 I want to clone specific tag from my repository in bitbucket. Now I am able to clone just the whole repository. What should I add to my code to clone specific tag? I have seen this but it doesnt really helped me : https://github.com/libgit2/git2go/issues/126 git_libgit2_init(); int num = 0; git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; clone_opts.checkout_opts = checkout_opts; clone_opts.fetch_opts.callbacks.credentials

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

when I use git clone to get a git from the remote, the git_index_entrycount return 0?

谁说我不能喝 提交于 2019-12-24 12:26:57
问题 I use git_repository_index to get the index first ,and then I use git_index_entrycount to see how many index items in it , but the result is 0? why? Below is my code, what's wrong with it? Thx (void)viewDidLoad { [super viewDidLoad]; git_repository *repo; progress_data pd = {{0}}; NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docPath = [array objectAtIndex:0]; git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT; git_checkout_opts

Unable to ssh push in pygit2

只愿长相守 提交于 2019-12-24 11:35:43
问题 I am trying to push using ssh to a github repo using pygit2. Here is the error I keep getting. Can you point out the error? >>> sshcred = repo_.pygit2.credentials.Keypair('avckp','id_rsa.pub','id_rsa','') >>> remo2.credentials=sshcred ## remo2 is a remote object for the repo >>> remo2.url u'https://github.com/avckp/sansa-pygit.git' >>> remo2.push_url = remo2.url >>> remo2.push('refs/heads/master') Traceback (most recent call last): File "<input>", line 1, in <module> File "pygit2/remote.py",

Create a tree object from a temporary index using libgit2 - git2go

六眼飞鱼酱① 提交于 2019-12-24 11:31:11
问题 On the command line I can do the following: $ touch foo $ GIT_INDEX_FILE=/tmp/tmp.d95ehfhUOffoo/index git add -A $ GIT_INDEX_FILE=/tmp/tmp.d95ehfhUOffoo/index git status -s A foo $ git status -s ?? foo $ GIT_INDEX_FILE=/tmp/tmp.d95ehfhUOffoo/index git write-tree b8f7b1e052b441b53a969014803516bb7e681760 $ git cat-file -p b8f7b1e052b441b53a969014803516bb7e681760 100644 blob ae3fdc2989ae00d75ec106feadb78ed9f98ba41a .gitignore 100644 blob 4e1e0d2f722485c7d284fb5cd7da855826e39b5a .rspec 100644

How to write a proper git pull with libgit2

感情迁移 提交于 2019-12-24 07:50:06
问题 I want to write a C++ libgit2 wrapper to perform some basic git operations because libgit2 is too much atomic to be used as is (in my opinion). As libgit2 is written in C , it does not matter if I get a C or C++ oriented solution, I will adapt it by myself. I encounter difficulties with the gitPull() function that is supposed to be the "git pull" equivalent. I planned to implement it as follows: git_remote_fetch() git_annotated_commit_from_fetchhead() git_merge() (with the previously got git

Doing git fetch && git merge from remote with git2go

痴心易碎 提交于 2019-12-24 03:43:12
问题 I'm using libgit2/git2go v0.22 and trying to implement something similar to a "git pull" from a remote repository. In this case The working directory doesn't write anything: no changes, no commits, no push. It will only pull data from the remote. Using git2go I can clone the remote repository, load/lookup a remote origin, fetch the remote, list remote headers, etc. It seems that the only step not working is the merge. My code looks like this (i'm ommiting the error handling): repo, err:= git

How do I use C headers from libgit2 without getting this error?

一笑奈何 提交于 2019-12-24 02:17:37
问题 I took everything from include/git2 to /usr/include, then tried compiling the following program: #include <stdio.h> #include <repository.h> int main(void) { puts("Hello, world!"); return 0; } When I compile this with GCC, I get the following error: maxwell@UNIX-PC:~$ gcc ok.c In file included from /usr/include/common.h:16:0, from /usr/include/repository.h:10, from ok.c:2: /usr/include/inttypes.h:33:2: error: #error "Use this header only with Microsoft Visual C++ compilers!" In file included