Pygit2: How to unstage a file?

In pygit2, if I stage the adding or removing of a file, how can I unstage them like I'd do with git reset? I need to use pygit2 to accomplish the following git actions: git reset HEAD git checkout...

Implementing Pull with Pygit2

I am trying to implement some 'porcelain' commands using pygit2. It seems that I have run into a bit of road block while implementing pull. Specifically the easiest pull case, a fast...

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...

Errors installing pygit2 on CentOs

I am trying to install pygit2 on Centos and am getting the following error I would be grateful if anyone could suggest what may be wrong thanks You are using pip version 7.1.0, however version...

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...

Error while installing pygit2

I have to install pygit2 library on my ubuntu machine. I get the below error when I try "pip install pygit2". cffi.ffiplatform.VerificationError: CompileError: command 'x86_64-linux-gnu-gcc'...

How to rebase with pygit2?

I'm stuck trying to implement a git rebase with pygit2. Assuming this repo history, how to rebase topic on master using pygit2 ? (ie, the equivalent of git rebase master topic): A---B---C...

Error while using pygit2 module in python

I am using pygit2-1.5.0 module in my python(3.8) code. It works properly on Linux environment however on windows I am getting following exception every time I try to import pygit2: >>>...

Pygit2 0.25.0 repository finding problem in windows XP

I'm writing python program to work with git repositories, it works right on win7, but I'm also need this program to work on win xp (win xp supports python 3.4, pygit2 0.28 wont work on win xp (dll...

delete a reference in pygit2

I am using the library pygit2 to implement a git module on my project. Right now i'm blocked by these 2 scenarios : - the deletion of a tag than a push - the deletion of a branch than a push this...

Redhat 7.0 Pygit2 install error

I am tried to install pygit2 python library with pip on Redhat 7.0 but i got the following error. If anybody have an idea how to solve this problem please let me know. I would really appraciate...

How to set the credentials in pygit2.clone_repository?

When I clone a repo from github by pygit2, it returns: 'OSError: Failed to send request: A security error occurred' The code is simple, import pygit2 username =...

Git porcelain commands via pygit2?

Pygit2 is a set of Python bindings to the libgit2 shared library, which implements the Git core methods. Unfortunately, it only seems to provide an API towards plumbing commands. Is there any...

Unable to ssh push in pygit2

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 =...

How do you checkout a branch with pygit2?

I want to use pygit2 to checkout a branch-name. For example, if I have two branches: master and new and HEAD is at master, I would expect to be able to do: import pygit2 repository =...

git logs between two tags using pygit2

Im trying to use pygit2 for this task, and I'm confused how to use the diff function in repo to do this https://www.pygit2.org/diff.html. from pygit2 import Repository from pygit2 import...

Untracked dirs on commit with pygit2

I'm working on a non-bare repository with pygit2 index = repo.index index.read() # write in test/test.txt index.add('test/test.txt') treeid = index.write_tree() repo.create_commit( ...

how to disable ssl verification on pygit2

I'm using pygit2 to programmatically clone a repo from an internal server which holds a self-signed certificate. The pygit2 raises an error on the certificate, how do I turn the verification off?

pygit2 unable to set local branch to upstream branch

I am using Pygit2 within python to checkout to a specific branch. Similar to git; however, I am unable to set the newly checkout branch to the remote branch (set upstream). PyGit2 Code: - What is...

Importing python-pygit2 correctly on RHEL7.2 (For use in SaltStack gitfs)

I'm trying to setup gitfs for SaltStack, using the pygit2 method. I've installed pygit2 and libgit2 on my machine: [[email protected] site-packages]# yum list installed | grep git2 libgit2.x86_64 ...

Replicating "git checkout <commit> with PyGit2

I am trying to replicate the behaviour of the command "git checkout (commit)" where (commit) is the reference to as specific commit and not a branch name. When using this command, the 'HEAD' of...

Install pygit2 with pip in the same version as libgit2

I have a project that depends on the pygit2 library. The pygit2 library in turn depends on the locally installed libgit2 and both have to match the minor-version:...

Installing libgit2 and pygit2 in archlinux docker

Trying to install libgit2 and pygit2 in docker. Keep running into errors no matter how I try. Current docker file: https://pastebin.com/jsbdqeEX Current error:...

how to interpret pygit2 status info

I am using pygit2 to access that status of the repo status = repo.status() for filepath,flags in status.items(): print (&quot;path %s flags %d&quot;, filepath, flags) I dont seem to be able...

pulling and integrating remote changes with pygit2

I do have the following problem. I'm writing a script which searches a folder for repositories, looks up the remotes on the net and pulls all new data into the repository, notifying me about new...

Installing libgit2 and pygit2 on Debian Docker

I have been trying to install pygit2 and libgit2 using a Debian:Jessie docker file. I was able to compile the package with almost the same packages with ubuntu, but not with debian. Below is the...

Create a branch on a remote repository with pygit2

I am using pygit2 to create a branch on a remote repository. If it was in a local repository i would've used : repo=pygit2.Repository(repo_url) ...

Pygit2 - Merging a branch with no fast forward

I am essentially trying to do a "git merge --no-ff branch" to merge my branch back in. Looking at the Pygit2 documentation, I am not entierly sure what the correct way to do this is. The direct...

pygit2 appears to return the wrong flags for repo.status()

I'm running repo.status().items() in a pre-commit hook using the -a flag (git commit -a -m &quot;Test&quot;), and I get a result that looks like this: [(&#39;config/git_hooks/pre-commit&#39;,...

get all repo commits using pygit2 with svn repos

Now i'm using git svn for cloning repos, when i want to get all their commits and store whem to the db. For getting all the commits i use pygit2.Repository but i see that i receive only commits...