Questions tagged [libgit2]

libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.

libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.

It is under active development, spear-headed by GitHub and Microsoft.

Along with the C API, bindings exists for many languages, including Ruby, .Net, Python and Objective-C.

629 questions
9
votes
1 answer

Using NodeGit CloneOptions to clone a branch

I am trying to work out how to pass clone options to the nodegit clone method. The node git documentation states that the 3rd param to the clone method is the clone options object http://www.nodegit.org/nodegit/#Repo-clone git.Repo.clone(URL, path,…
Anthony McCormick
  • 2,724
  • 3
  • 25
  • 27
9
votes
1 answer

How to get the last commit from HEAD in a git repository using libGit2Sharp?

How can I get the last Commit from the current Head? I guess I need to get the current Branch (repo.Head), then the SHA1 (how?) and then lookup the commit using the SHA1 (how?).
zpete
  • 1,725
  • 2
  • 18
  • 31
8
votes
2 answers

Is any body making a windows replacement to msysgit with libgit2,libgit2sharp, Ngit?

Hi I like Git but it seems sharing windows projects with people and friends is not fun because gitextensions tortoisegit are ugly to use out of the box compared to tortoisehg or tortoisesvn (not that it's DVCS). Using msysgit just in a bash shell…
sabgenton
  • 1,823
  • 1
  • 12
  • 20
8
votes
1 answer

Get changes between a commit and its parent with libgit2sharp

I am working with libgit2sharp (a C# wrapper for libgit2) and have been running into issues because it doesnt have a lot of the functionality I am hoping for (hopefully I can contribute to it soon; this seems like a really useful project) The thing…
bashirs
  • 452
  • 1
  • 7
  • 14
8
votes
3 answers

Can you use libgit2 to clone a git repository?

Is there a way to create a new clone of a git repo using libgit2? From the libgit2 usage guide (http://libgit2.github.com/api.html), various examples docs (http://schacon.github.com/libgit2-examples/ etc.) and the "repository" libgit2 api docs…
Trent Mick
  • 199
  • 1
  • 6
8
votes
3 answers

LibGit2Sharp The Index is locked - Error

Sometimes I try to read and write to a Git repository at the same time. But afterwards i get the following error message when i try to commit files: An error was raised by libgit2. Category = Index (LockedFile). The index is locked. This might be…
JoeLiBuDa
  • 219
  • 2
  • 10
8
votes
2 answers

What's the fastest way to find Tags pointing to Commits?

With libgit2sharp I would like to do the following: foreach( Commit commit in repo.Commits ) { // How to implement assignedTags? foreach( Tag tag in commit.assignedTags ) {} } I want to get all tags assigned to the current commit. Whats the…
zpete
  • 1,725
  • 2
  • 18
  • 31
8
votes
3 answers

Listing all commits in a branch using libgit2

How can I walk through all the commits of a branch using libgit2? I have already the following bit of code, but it doesn't compile. #include #include #include #include int main(int argc, char *argv[]){ …
0xpentix
  • 732
  • 9
  • 22
8
votes
0 answers

libgit2 equivalent of git log

I'm trying to do the equivalent of the following using libgit2: git log -z --all --topo-order I'm having trouble with 1) finding the easiest way to push all the refs into the revwalker and 2) getting the results in the same order. I keep seeing…
Uncommon
  • 3,323
  • 2
  • 18
  • 36
7
votes
1 answer

How to add a custom object database to libgit2?

I try to understand how to implement a custom object database in libgit2. As the main entry point I already checked out the example repository called libgit2-backends which implements examples for memcached, mysql, redis and sqlite3. But I still…
Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
7
votes
1 answer

How to retrieve all object IDs?

I am trying to get a list of all object IDs in a git repository, using libgit2. I can't seem to find any method for this. Does libgit2 have a method to get all object IDs (or iterate through them), or do I need to read them manually?
user142019
7
votes
3 answers

Create new git repository from a branch of another using libgit2?

In C++ using libgit2, I'd like to create a new local repository where its master branch is based on specific-branch from another local repository, maintaining its history so I can later synch between the two. Essentially, I'm attempting the…
Mike Weir
  • 3,094
  • 1
  • 30
  • 46
7
votes
1 answer

Checkout branch with libgit2

I'm trying to implement a simple checkout operation between 2 branches. The code executes without errors. git_libgit2_init(); git_object *treeish = NULL; git_checkout_options opts; opts.checkout_strategy = GIT_CHECKOUT_SAFE; /* branchName in this…
Abdelilah El Aissaoui
  • 4,204
  • 2
  • 27
  • 47
7
votes
0 answers

Installing package from GitLab with devtools::install_git through a proxy throws 'Installation failed: Error in 'git2r_clone'' error

Executive summary: devtools::install_git with GitLab through a proxy throws an Installation failed: Error in 'git2r_clone': failed to send request: A connection with the server could not be established error. Custom package (R default example): To…
m-dz
  • 2,342
  • 17
  • 29
7
votes
3 answers

Programmatically do "Git blame -w" in C#

I need to programmatically get the last author of a specific line in the Git history with C#. I tried using libgit2sharp : var repo = new LibGit2Sharp.Repository(gitRepositoryPath); string relativePath = MakeRelativeSimple(filename); var blameHunks…
JYL
  • 8,228
  • 5
  • 39
  • 63
1
2
3
41 42