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
1 vote
1 answer
159 views

Add safe directory with gitpython

How do I run this git command with gitpython(v2.1.*), please ? git config --global --add safe.directory "some_dir" Couldn't find in doc. I tried this: repo = git.Repo.init(some_dir) config =...
Ticoincoin'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
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
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
1 vote
1 answer
364 views

Download files temporarily from a git repo - leaves orphaned git process

I want to get the contents of a git repo into a temporary directory so I can copy the files I need elsewhere and then delete the rest. I've done this: import git import contextlib import tempfile @...
Greedo's user avatar
  • 5,563
2 votes
1 answer
357 views

Extract paths to modified files except for deleted or renamed files

I need to get the paths to the files that were changed in the last commit using GitPython. I managed to do it this way: import os from git import Repo repo = Repo(os.path.dirname(sys.argv[0])) commit ...
Helen's user avatar
  • 543
1 vote
0 answers
289 views

How to make gitpython ask for authentication credentials every time?

I use gitpython for cloning, pulling, committing, and pushing repo. While cloning, it asks for a username, and password and stored inside .git/configs. So every time, a user makes a commit and push it ...
Tanmay Jain's user avatar
0 votes
0 answers
140 views

On Windows 10 (using cygwin running python GitPython), how to do a git pull?

With this Python code (using GitPython) (passing 'sqa' as branch): def git_pull(self, branch_name): self.repo.git.checkout(branch_name) branch = self.repo.active_branch ...
user10664542's user avatar
  • 1,326
1 vote
1 answer
2k views

getting difference of commits between two branches using gitpython

What I want to achieve can be done using command line git as follows git log stage..develop commit ea31b4f01f02af91f31.....b34895e1c825 (origin/develop, develop) Author: author <[email protected]&...
codeaprendiz's user avatar
  • 3,215
1 vote
0 answers
549 views

Commit file changes using Python

I want to overwrite a text file using Python and commit each iteration into a Git repo, so that I can analyze the file, seeing something like this for each commit: -Number1 +Number2 I had the idea of ...
geier1's user avatar
  • 11
5 votes
2 answers
7k views

How to install gitpython with, Failed to initialize: Bad git executable

I am trying to install git-python on Windows. I tried to install it using the git command: pip install gitpython It installed just fine and it install in my local app data. The only problem was is ...
Cyber_Pig_908's user avatar
0 votes
1 answer
729 views

Clone repository and "checkout" to "tags/<my_tag>

I clone a repository using Repo.clone_from(). Afterwards, I simply want to switch to a specified tag within the repository, similar to git checkout tags/<my_tag>. I found the following solution, ...
conFusl's user avatar
  • 949
0 votes
1 answer
1k views

Looking to use GitPython to clone a repostiory in Lambda

I'm looking for a way to use Git and Lambda together to help manage our AWS users, this is what I would like to achieve... End user creates a PR with a new/updated IAM policy document for the ...
Reuben deVries's user avatar
4 votes
2 answers
10k views

How to get the latest commit hash on remote using gitpython?

Is there a way that I can get the most recent commit on a remote repository using gitpython? I do not want to perform operations like a pull or merge on my local branch. I also do not want to depend ...
oyeesh's user avatar
  • 581

15 30 50 per page