Skip to main content

All Questions

Tagged with
0 votes
0 answers
97 views

GitPython unable to execute command in existing repository

I am trying to run a script with GitPython, but it seems to only fail when I run from inside the Jenkins automation environment. The error that it gives isn't very helpful (and I haven't been able to ...
snowwolf75's user avatar
0 votes
1 answer
87 views

Azure devops throwing stderr: 'fatal: You are not currently on a branch.' when trying to push the code to checked out branch using GitPython library

I am trying to check out a git branch,generate files using python code and then push the changes to the branch using GitPython library Below is the code used repo = git.Repo(...
Sachin Shetty's user avatar
0 votes
2 answers
93 views

How can I get head of branch with illegal characters in it

I know you can get the head of a branch directly using it's name (e.g. repo.heads.main). Can you get the head of a branch that has illegal variable characters (e.g. feature-generate-events) directly ...
Stephen Rasku's user avatar
0 votes
0 answers
109 views

Trouble pushing to Git remote using GitPython: "remote unpack failed" and "RPC failed; HTTP 500"

I'm encountering issues when trying to push changes to a Git remote repository using GitPython. I'm receiving two different errors intermittently, and I'm unsure how to resolve them. Error 1 error: ...
Ame Suzuki's user avatar
0 votes
1 answer
661 views

Git diff against master branch using GitPython

I must be dense, but I haven't been able to find a solution yet. I am trying to get a list of all of the members (in all commits or not committed yet) that have changed on a branch in my Python ...
Mark Hammack's user avatar
0 votes
1 answer
195 views

How to call rev_list with GitPython

This program fails import git repo = git.repo.Repo('..') res = repo.git.rev_list('--since="2024-01-01" master').split('\n') with the following error git.exc.GitCommandError: Cmd('git') ...
Dmitry's user avatar
  • 1,319
0 votes
1 answer
1k views

Get list of directories and files in git repo using Python

I want to fetch all files and directories present in a git repo using Python and then parse through each directory to get details of files present under them. Below is the piece of code I have been ...
Shivani's user avatar
0 votes
1 answer
58 views

gitpython commit not writing to disk

I am trying to write a basic script that is pulling replicating the contents of one directory into another one, but making some modifications along the way. The items written in the new directory are ...
Panduar's user avatar
  • 31
1 vote
0 answers
606 views

How to clone Azure DevOps git repository with OAuth token from service principal?

I am trying to clone an Azure DevOps git repository using an Azure app registration/service principal. I was successful in bash with the help of this answer. Sadly, adapting it to GitPython results in ...
Felix Thein's user avatar
0 votes
1 answer
327 views

GitPython: get rename files as deleted and added

I need to get git diff files since specific commit using GitPython. As I understood I get renamed files using 'R' type . Is it possible to get the rename_from in the deleted lists and the rename_to in ...
Leah's user avatar
  • 29
0 votes
1 answer
160 views

Retrieving SHA from gitpython when User is not Owner of Cloned Repo on Windows 11?

I am using the gitpython library to obtain the SHA of Python code during execution on a Windows 11 Enterprise PC. It works fine when I do it as I cloned the repo. When another user tries to run the ...
Bobby's user avatar
  • 23
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
0 votes
1 answer
507 views

GitPython find most recent tag in the current branch only

I am using this code snippet with GitPython to capture the current branch, most recent commit, and most recent tag. This information will be inserted into a version string. repo = git.Repo(...
Steve's user avatar
  • 1,312
1 vote
0 answers
375 views

How do I set a progress bar when cloning a repository with GitPython?

I would like to set a progress bar when cloning a repository with GitPython, by using some library such as tqdm. For the moment I wrote the following code in the main.py: import git ...some code... ...
Admin's user avatar
  • 49
1 vote
1 answer
180 views

Have GitPython stage itself

I am new to GitPython and I am trying to have a python program stage itself to a new git repository (my-new-repo). My main.py is as follows: import git repo = git.Repo.init('my-new-repo') # List all ...
Hitesh Arora's user avatar

15 30 50 per page
1
2 3 4 5
18