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
7
votes
2 answers

Any native git command line tool based on libgit2?

As libgit2 is a library, is there any existing C/C++ project which depends on libgit2 and exposes the usual Git command line interfaces (like git clone, git commit, etc.)?
Thomson
  • 20,586
  • 28
  • 90
  • 134
7
votes
2 answers

How to configure libgit2 in TFS Build with private repositories?

I am currently using TFS 2013 (local installation) to try to build from an internal GitHub Enterprise installation using LDAP Authentication. The problem I am getting is that it cannot access the source code, how can I configure TFS Build to use a…
Tom Anderson
  • 10,807
  • 3
  • 46
  • 63
7
votes
3 answers

An error was raised by libgit2. Category = Os (Error)

I have run into this several times now: An error was raised by libgit2. Category = Os (Error). Which sometimes causes this or similar error while i am writing code: Failed to open '.../App_Data/....mdf': The process cannot access the file…
Komengem
  • 3,662
  • 7
  • 33
  • 57
7
votes
1 answer

Implementing 'git pull' with libgit2?

I have a relatively short Gist which is supposed to use libgit2 to emulate the functionality of the git pull command. Unfortunately, it's not quite working. In summary, the snippet: calls git_repository_open() to open the repository on disk calls…
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
7
votes
2 answers

pygit2 blob history

I'm trying to do the equivalent of git log filename in a git bare repository using pygit2. The documentation only explains how to do a git log like this: from pygit2 import GIT_SORT_TIME for commit in repo.walk(oid, GIT_SORT_TIME): …
user1415785
  • 342
  • 4
  • 13
7
votes
2 answers

How to find all commits having a particular parent?

How may I find all commits in a repository that have a specific parent? For example, if I have a commit A, I would like to find all other commits that share the parent with A. What would be the most effective, i.e. performant yet correct way to do…
Tower
  • 98,741
  • 129
  • 357
  • 507
6
votes
0 answers

How to squash commits in a rebase using libgit2?

I have a Git repository with the following git log information in master: commit 23c5565d156266f3e26943d0811abaa88f7957a1 (HEAD -> master) Fourth commit. commit 92c0d491c3fd537a06876d1c0fc69c27ebf3e935 Third commit. commit…
Bryan Muscedere
  • 572
  • 2
  • 10
  • 23
6
votes
1 answer

How to perform "git pull" with the Rust git2 crate?

The git2 crate doesn't have direct way to perform "git pull" action. I've seen this question and tried to do it the same way (playground): use std::fs; use std::fs::File; use std::io::{stderr, stdout, Write}; use std::path::Path; use git2::{Commit,…
Argentumbolo
  • 147
  • 1
  • 7
6
votes
1 answer

libgit2 git_checkout_head with GIT_CHECKOUT_SAFE do nothing with working dir

I'm trying to do branch switching using libgit2. Repo already cloned and references to existing remote branches created. If I put GIT_CHECKOUT_FORCE to checkout_strategy, it works as expected - create missing, modify existing, delete removed. If…
Vadim
  • 93
  • 5
6
votes
2 answers

Download one file from remote (git show) using libgit2sharp

Using git show, I can fetch the contents of a particular file from a particular commit, without changing the state of my local clone: $ git show $ git show : How can I achieve this programatically using libgit2sharp?
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
6
votes
1 answer

Using SSH authentification with libgit2

I am trying to authenticate against a git server with libgit2 using SSH keys. So far, this is working for URLs like ssh://myuser@host.domain:1234/dirs/repo.git, where my application accepts the URL as an argument. However, if I remove the username…
andreee
  • 4,459
  • 22
  • 42
6
votes
3 answers

Git stash on windows extremly slow compared to Libgit2

Recently I've been using git stash many times and I've been thinking that it is really slow, even on a new repository with a single file. I've read this question about git stash slowness and this other one and tried every answer to these questions…
Abdelilah El Aissaoui
  • 4,204
  • 2
  • 27
  • 47
6
votes
1 answer

How to create a git repository in memory?

I am currently working on a flashcard application where decks created by the user act as Git repositories. When a card is created in the app, a new file is committed to the repository, when a card is changed, the file is changed, and when a card is…
birdoftheday
  • 816
  • 7
  • 13
6
votes
1 answer

Doing a Git Pull with libgit2

I've looked at the answer in this post (libgit2 (fetch & merge & commit)) but I am struggling to get a Git Pull to work. I get no error messages. The Fetch appears to work but the Merge doesn't occur. Doing a Git Status shows that my branch is…
Anthony
  • 101
  • 1
  • 6
6
votes
2 answers

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

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…
Raghu
  • 2,859
  • 4
  • 33
  • 65
1 2
3
41 42