Skip to main content

All Questions

Tagged with
3 votes
1 answer
554 views

How to fetch an orphaned commit?

tl;dr: I have a repository cloned but cannot see an orphaned commit locally. How can I get that commit if it did not come with the repo? Details: I am trying to get the contents of a specific file on ...
smgtkn's user avatar
  • 140
2 votes
0 answers
67 views

How to get files change of a given branch?

I struggle to find how to get the list of files that have been modified on my current branch (and ONLY on my current branch, not on the other branches). For example, I have a branch my_branch based on ...
lucas_v67's user avatar
1 vote
0 answers
970 views

How get source code of files in a commit with GitPython?

I need to get source codes for all files in a commit. Currently I am using Pydriller and it works well. But for performance reasons I need to use GitPython. I have tried this solution: repo = Repo('...
Domenico Antonio Tropeano's user avatar
6 votes
3 answers
4k views

Iterate commits b/w 2 specified commits in GitPython

import git repo = git.Repo(repo_dir) ref_name = 'master' for commit in repo.iter_commits(rev=ref_name): <some code here> This code iterates through all the commits. I want to iterate b/w 2 ...
Shayan Anwar's user avatar
1 vote
0 answers
807 views

GitPython - git add - error - file not recognised

I am facing problems when trying to add a specific filename to a commit. I can get it working via --all or u=True etc. but when I state the specific name within the command, it gives me the following ...
DB-93's user avatar
  • 13
3 votes
2 answers
4k views

Get tags of a commit

Given an object of GitPython Commit, how can I get the tags related to this commit? I'd enjoy having something like: next(repo.iter_commits()).tags
Uko's user avatar
  • 13.4k