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
23
votes
3 answers

How to retrieve the history of a file?

I got another libgit2 issue and will be very grateful for your help. I'm trying to retrieve file history, i.e. list of commits where this file was changed. And it seems to be quite unconventional... As far as I can see, there are no function for…
shytikov
  • 9,155
  • 8
  • 56
  • 103
21
votes
2 answers

Which code is shared between the original Git and libgit2?

Which code and how much code do the original Git codebase and libgit2 have in common (from nothing to all Git functionality except of command line client entry points)? I'm primarily interested in how "stable" libgit2 is and how easily and quickly…
mstrap
  • 16,808
  • 10
  • 56
  • 86
16
votes
3 answers

How to get the behaviour of `git checkout ...` in Rust git2

I am using the Rust git2 crate to clone Git repositories like this use git2::Repository; fn main() { let repo = Repository::clone( "https://github.com/rossmacarthur/dotfiles", "dotfiles" ).expect("failed to clone…
Ross MacArthur
  • 4,735
  • 1
  • 24
  • 36
15
votes
2 answers

Create a commit using pygit2

I would like to make a commit on a branch (master for example). I am making a repository clone using pygit2 (pygit2.clone_repository) Then I change an existing file in the repository. Afterwards I run this to make a commit: index =…
user1479699
  • 153
  • 1
  • 5
15
votes
1 answer

libgit2 returned: Refspec 'refs/heads/origin/HEAD' not found error in TortoiseGit

I got this error when starting up TortoiseGit: Could not get all refs. libgit2 returned: Refspec 'refs/heads/origin/HEAD' not found While annoying, it does not prevent me from using TortoiseGit. However, I'd like to make it go away, because it…
user456814
13
votes
1 answer

Git repository internal format explained

Is there any documentation on how Git stores files in his repository? I'm try to search over the Internet, but no usable results. Maybe I'm using incorrect query or maybe this is great secret — Git repository internal format? Let me explain, why I…
shytikov
  • 9,155
  • 8
  • 56
  • 103
13
votes
4 answers

Git Commit Parents' Order

Is there some convention for the order of a commit's parents? Because one of the commit's parents should be to be to previous commit on the current branch that is being merged into and the rest are previous commits of the other merging branches. I…
Emil Davtyan
  • 13,808
  • 5
  • 44
  • 66
11
votes
4 answers

Is there a better database than Git (with serializable, immutable, versioned trees)?

Imagine the data structure behind Git. It's like a confluently persistent data structure, except using hash references instead of traditional pointers. I need Git's data structure, except without any of the working tree and index stuff. And there…
Lilith River
  • 16,204
  • 2
  • 44
  • 76
11
votes
1 answer

Difference between Git and libgit2

I'm not sure whether I understood the difference between git and libgit2 correctly because the repository of git is different from libgit2, I mean they are not the same. I want to know is there any difference between these two libraries or not?
Afshin Mehrabani
  • 33,262
  • 29
  • 136
  • 201
11
votes
4 answers

What is the LibGit2Sharp equivalent of git log path?

How do I get a list of commits which contain a particular file, ie the equivalent of git log path for LibGit2Sharp. Has it not been implemented or is there a way that I'm missing?
toofarsideways
  • 3,956
  • 2
  • 31
  • 51
11
votes
4 answers

Why am I missing git2.h and how do I get it back?

I am experiencing an odd problem every time I try the set-up of pygit2. Below is what I run and the error generated. $ python3 setup.py install running install running build running build_py running build_ext building '_pygit2'…
nzaccardi
  • 354
  • 1
  • 3
  • 11
10
votes
2 answers

go 1.5 cross compile using cgo on OS X to linux and windows

I'm having trouble compiling the git2go library on OS X to linux amd64 after upgrading go 1.4.2 to go 1.5. I think this is about cross compiling any go app that uses C code with go 1.5. Using CGO_ENABLED=1, I get: $ CGO_ENABLED=1 GOOS=linux…
Calin
  • 2,110
  • 1
  • 21
  • 36
10
votes
3 answers

How do I get the name of the current branch in libgit2?

I am trying to use libgit2 to read the name of the current branch. Do I have to do some sort of resolve? I tried using git_branch_lookup to look up the git_reference for HEAD, but it results in Unable to find local branch 'HEAD' Thanks!
Jake
  • 15,007
  • 22
  • 70
  • 86
9
votes
2 answers

Git2go - pull && merge

I am trying to implement something that will give me the outcome of git pull or git fetch && git merge. I got this working in part, but the problem I am having is that after running the following code, the current repo is left thinking that there…
Sthe
  • 2,575
  • 2
  • 31
  • 48
9
votes
2 answers

how to commit and push in libgit2sharp

I just downloaded the nugget package for libgit2sharp. I am finding it difficult to do even basic operations. I have an existing git repo (both remote and local). I just need to commit new changes when it occurs and push it to the remote. I have…
user3900196
  • 457
  • 2
  • 6
  • 18
1
2 3
41 42