GitPython is a python library used to interact with Git repositories

learn more… | top users | synonyms

5
votes
2answers
903 views

git log --follow, the gitpython way

I am trying to access the commit history of a single file as in: git log --follow -- <filename> I have to use gitpython, so what I am doing now is: import git g = git.Git('repo_dir') ...
2
votes
1answer
371 views

GitPython create local branch from remote branch

I have multiple lab machines and I need to make a copy of my remote branch on my local lab machine. I believe the git bash command for this is: git checkout -b mybranch origin/mybranch How do I ...
2
votes
1answer
138 views

Checking if an object is in a repo in gitpython

I'm working on a program that will be adding and updating files in a git repo. Since I can't be sure if a file that I am working with is currently in the repo, I need to check its existence - an ...
1
vote
1answer
29 views

gitpython and git diff

I am looking to get only the diff of a file changed from a git repo. Right now, I am using gitpython to actually get the commit objects and the files of git changes, but I want to do a dependency ...
2
votes
0answers
174 views

GitPython equivalent of “git remote show origin”?

I'm trying to update a Python script that checks the status of a handful of local repositories against remotes from using subprocess to using GitPython. What is the equivalent command in GitPython for ...
1
vote
0answers
24 views

How to checkout a tag with GitPython

In a python script, I try to checkout a tag after cloning a git repository. I use GitPython 0.3.2. #!/usr/bin/env python import git g = git.Git() g.clone("user@host:repos") g = git.Git(repos) ...
0
votes
0answers
41 views

Using (or abusing?) GitPython

I've created a custom widget in wxPython which though not yet perfect, is good enough to add to one of my projects (call this widget v1.). I want to keep working on/experimenting with the widget, but ...
0
votes
0answers
155 views

Git commit from Python with GitPython delete files committed from command line

Here is the code I use to create a new file and commit it : # We are inside a home-made class, using GitPython # So self.repo is a Repo() object from GitPython module def set_content(self, path, ...