Questions tagged [pygit2]

Pygit2 is a set of Python bindings to the libgit2 shared library.

Pygit2 is a set of Python bindings to the libgit2 shared library, libgit2 implements the core of Git. Pygit2 works with Python 2.6, 2.7, 3.1, 3.2 and 3.3

Pygit2 links:

82 questions
1
vote
1 answer

How get list submodules from git bare repo without create working tree?

How get list submodules in git bare repo without create working tree? (with low level library libgit2 or git console)?
1
vote
0 answers

How to get branch name if checked out to origin/branch with pygit2?

If the cloned repo is in detached HEAD state and points to origin/, how do I get the original branch name? git status shows HEAD detached at origin/, so it should be possible to retrieve the name.
Anton K
  • 71
  • 6
1
vote
1 answer

pygit2: How to "git remote set-branches origin remote_branch_name"

Title says it all. I am using pygit2 and trying to figure out how to achieve following that I can do using git cli: git remote set-branches origin remote_branch_name
hasanatkazmi
  • 8,041
  • 2
  • 22
  • 18
1
vote
1 answer

How to get name current bramch name in a git repository using python

This is the script to get the current branch name in git using ssh key URL = raw_input('Enter the ssh git URL: ') print URL from pygit2 import Repository repo = Repository(URL) # option 1 head = repo.head print("Head is " + head.name) # option…
kishore
  • 41
  • 1
  • 4
1
vote
1 answer

Get all the file Contents of a repo at Specific Commit using PyGitHub

I want to get the file contents of all the files in the repo [changed and unchanged] using the Python [PyGitHub API]. But not sure how to achieve it. Simply, to browse the repo at that specific commit id in history. Is there any other API to get…
lucifer7
  • 13
  • 3
1
vote
1 answer

HEAD detatched from origin/master when merging with pygit2

I am using pygit2 to merge some branches of a project, however whenever I merge them I end up with: def avoid_walls(directions, board, snake): <<<<<<< HEAD return directions ======= z = 1 moves = [] for direction in directions: new_x =…
Pottsiex5
  • 487
  • 2
  • 6
  • 19
1
vote
0 answers

issues installing pygit2 on windows

I am trying to install http://www.pygit2.org/install.html#installing-on-windows As part of that I Installed in windows Cmake(Cmake-gui). when I selected in Source code-libgit2-0.26.0 (downloaded from…
user826407
  • 159
  • 1
  • 8
1
vote
2 answers

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 ("path %s flags %d", filepath, flags) I dont seem to be able to find any documentation on how to interpret the flags Could…
GrahamL
  • 243
  • 2
  • 15
1
vote
1 answer

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 9.0.1 is available. You should consider upgrading via…
GrahamL
  • 243
  • 2
  • 15
1
vote
1 answer

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: [root@r9tvap1109 site-packages]# yum list installed | grep git2 libgit2.x86_64 0.21.5-1.el7 …
1
vote
1 answer

How can I perform a rebase with pygit2?

This question touches on how to perform a merge with pygit2, but, to the best of my understanding, that will result in a new commit. Is there a way to perform a rebase, which will not result in a new commit and will simply fast-forward the branch…
Piotrek
  • 102
  • 7
1
vote
1 answer

List all commits since last release when the tag points to a commit on other branch

I need to list all the commits made to the master branch since my last release. I have to implement this functionality using pygit2. But the situation is a bit different here. The release is made on the master branch using a tag on a commit to other…
darxtrix
  • 2,032
  • 2
  • 23
  • 30
1
vote
1 answer

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?
user3236929
  • 123
  • 1
  • 2
  • 7
1
vote
1 answer

How do i push to remote with pygit2?

i want to clone a repository, change a file and push these changed file back to the origin branch. I can clone the repo with repo = pygit2.clone_repository(repo_url, local_dir, checkout_branch="test_it") but what do i need to do now to push the…
topic2k
  • 11
  • 1
  • 2
  • 5
1
vote
1 answer

How I make pip see libgit2 binary while installing pygit2 in windows?

I'm trying to install pygit2 using pip python script, but it always fails with this message error: Unable to find vcvarsall.bat I don't have Visual Studio installed, so I tried to compile libgit2 using MinGW and it worked. but pip still cant figure…
Ahmed T. Ali
  • 1,021
  • 1
  • 13
  • 22