Questions tagged [gitpython]

GitPython is a python library used to interact with Git repositories

GitPython is a python library used to interact with Git repositories, providing object model access.

495 questions
0
votes
0 answers

use GitPython on remote machine

Using GitPython locally is peace of cake, I need clone, pull, commit git repository on remote machine. I know I can wrap bash/git commands with paramiko, but I need find out if there is any way to do it with GitPython objects, maybe with help…
emcek
  • 459
  • 1
  • 6
  • 17
0
votes
1 answer

gitpython open a repository from somwhere within the repository

Within a python script which I would like to be able to execute from some arbitrary location within a git repositories working tree, in some arbitrary git repository, and I would like to use GitPython to extract some information about said…
Spacemoose
  • 3,856
  • 1
  • 27
  • 48
0
votes
0 answers

How to check out spesific revision using GitPython?

I want to check out a spesific revision of a git repo. How to do this using GitPython? # GitPython==1.0.1 from git import Repo r = Repo.clone_from(git_url, repo_dir) #r.checkout(revision) # How to do this?
Jon Skarpeteig
  • 4,118
  • 7
  • 34
  • 53
0
votes
1 answer

GitPython equivalent of git update-ref?

I would like to create a new reference that is not a tag nor a branch, in the same way git update-ref would: git update-ref refs/pull/201/head ac8d616ea3598e49935908e5685e72038a37cd8f How can I do that with GitPython ? I found TagReference.create…
Loic Dachary
  • 1,034
  • 1
  • 10
  • 24
0
votes
1 answer

git for-each-ref equivalent in GitPython?

I would like to iterate over all the references using the GitPython API, in the same way git for-each-ref does it. How can I do that ?
Loic Dachary
  • 1,034
  • 1
  • 10
  • 24
0
votes
1 answer

How to create a repository in github.com using gitpython package

I have tried to create a repository in github with my python program. I found gitpython package in web-search. I can able to pull repository but unable to create a repository in github. please help me.
anjaneyulubatta505
  • 10,713
  • 1
  • 52
  • 62
0
votes
1 answer

Disable popup of cmd windows when using gitpython and py2exe?

On using gitpython on Windows with py2exe, every operation that is invoked by gitpython results in a cmd popup window. It seems to be that gitpython is using subprocess internally. Is there a way to specify the following equivalent in…
net_j
  • 205
  • 2
  • 9
0
votes
1 answer

SSH identity key ignored when using gitpython under supervisor

I have a simple Flask app that waits for webhooks from my repository host. The webhook triggers a git.pull() of the latest revision from a predefined repository using gitpython. The gitpython code is something like: import git repo_dir =…
SunPowered
  • 706
  • 4
  • 17
0
votes
1 answer

GitPython: git.diff(commit_a, commit_b) always returns empty string

When I try the following code using GitPython: repo.head.commit.diff('HEAD~1')[0].diff It always returns an empty string. I've changed the file many times I tried in different commits as well. I've also tried the following code that would list all…
PBMartins
  • 5
  • 2
0
votes
2 answers

GitPython equivalent command

I need a GitPython equivalent command or commands of this git clone -b --recursive . I hope the subprocess call is not the only way to do this. If anybody have an idea please let me know.
eszik.k
  • 1,729
  • 4
  • 17
  • 40
0
votes
1 answer

How to get the unique part of a ref ID with GitPython?

GitPython allows me to work on Git working copies. I'd like to use it. But how would I fetch the unique part, i.e. the "abbreviated ref ID", using GitPython? So I am interested in what the --abbrev-commit option to git log gives me (e.g. in git log…
0xC0000022L
  • 20,597
  • 9
  • 86
  • 152
0
votes
1 answer

Using GIT_SSH_COMMAND with GitPython

I'm using GitPython to initialize a new local repository, create the initial commit and push to a canonical repository. Unfortunately, the last step is failing and I'm having a lot of trouble understanding why. I'm sure I'm just using the…
Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192
0
votes
1 answer

git diff hexsha:directorypath/file

Given that hexsha, directory and file are known, how can I get the diff between 2 specific files, for example the following will return the diff between 2…
nskalis
  • 2,232
  • 8
  • 30
  • 49
0
votes
2 answers

GitPython - Repo.clone results in TypeError: execve() arg 2 must contain only strings

I'm executing the following GitPython related code to clone from a remote repository. The remote repo url is usually of format https://username:password@host/path/to/repo.git. Repo.clone_from(repo_url, local_repo_path) This results in the following…
chamilad
  • 1,619
  • 3
  • 23
  • 40
0
votes
1 answer

GitPython - clone_from not working

I am facing an issue while cloning a git repo. I am using function clone_from from GitPython library from git import Repo Repo.clone_from("git://github.com/facebook/buck.git", "D:\sample") I am getting error WindowsError: The system cannot find…
1 2 3
32
33