GitPython is a python library used to interact with Git repositories
0
votes
0answers
5 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 ...
0
votes
0answers
39 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 ...
1
vote
3answers
163 views
Finding the first commit on a branch with GitPython
I'm writing a git post-receive hook using Python and Git-Python that gathers information about the commits contained in a push, then updates our bug tracker and IM with a summary. I'm having trouble ...
0
votes
1answer
95 views
Does GitPython works with Python 3.x?
If "yes", is there any difference when it's used with Python 2. ?
I found this, but I would say the answer isn't clear for me.
Thanks.
0
votes
1answer
68 views
GitPython: Determine files that were deleted in a specific commit
Using gitpython, I am trying to get a list of changed paths; that is, of all the added, changed and deleted files.
I can retrieve the changed and added files from the commit:
checkout commit 'X'
...
1
vote
1answer
85 views
How to get count of unpublished commit with GitPython?
With git status I can get information about count of unpublished commits:
ยป git status
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
# (use "git push" to ...
0
votes
1answer
77 views
How can I specify the committed_date of a Commit using GitPython?
I would like to commit a file with a custom date.
So far I've created a Commit object, but I don't understand how to bind it to a repo.
from git import *
repo = Repo('path/to/repo')
comm = ...
1
vote
1answer
149 views
Edit a commit with gitpython
Lets say you're in the terminal, currently sitting at the root of a git repo.
If you've got GitPython installed, you can do this to get the last committed commit, or rather, the commit that HEAD ...
0
votes
0answers
152 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, ...
2
votes
1answer
162 views
gitpython error when checking if repo is dirty
I receive an error while trying to use gitpython to check if a repository is dirty, i.e. has uncommitted changed to tracked files:
import git
repo = git.Repo('')
print repo.is_dirty()
The error:
...
2
votes
1answer
80 views
gitpython creating zip archive
How can I create an archive with gitpython, I tried the following which creates the file but I can't open it it tells me an error occurred reading archive the archive appears to be invalid or damaged
...
1
vote
1answer
499 views
How can I pull a remote repository with GitPython?
I am trying to find the way to pull a git repository using gitPython.
So far this is what I have taken from the official docs in ...
2
votes
0answers
169 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 ...
2
votes
1answer
356 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 ...
0
votes
1answer
124 views
How to do a git reset --hard using gitPython?
Well the title is self explanatory. What will be the python code equivalent to running git reset --hard (on terminal) using GitPython module?