Questions tagged [gitpython]

GitPython is a python library used to interact with Git repositories

GitPython is a python library used to interact with Git repositories, providing object model access.

495 questions
0
votes
1 answer

How to skip Windows Credentials Manager using GitPython

I am using GitPython to execute git commands that require authentication such as git clone. I am using Windows. My configured credential helper is Windows' Credential Manager and I don't want to change it. That's why when the program runs, I enter…
ybalcanci
  • 93
  • 1
  • 7
0
votes
1 answer

gitpython can't find git commands despite git being installed

I've install git python, details: Python 3.8.1 git version 2.21.1 (Apple Git-122.3) GitPython==3.1.0 gitdb==4.0.2 OS is Catalina virtual environment via pyenv, pyenv-virtualenv, pyenv-virtualenvwrapper git is located in /usr/bin/git running this…
Alesi Rowland
  • 379
  • 2
  • 16
0
votes
0 answers

Git push using gitpython library

I have tried this python code to push to my repository. When I execute it, it says code push successful. But when I logged in to my BitBucket, I understood that it didn't push anything. Please help me resolve this issue. Thanks in advance. from git…
deeksha
  • 17
  • 7
0
votes
0 answers

cmd.stdin.flush() IOError: [Errno 22] Invalid argument

Basically i'm running massive python script that runs for hours. Oftenly i'm using the the Commit object like repo.commit(some_valid_hexsah). I'm using it over and over again, and doing lots of stuff in between. For unknown reason, after some time,…
Rotem Barak
  • 154
  • 1
  • 9
0
votes
1 answer

How to get all the changes on a specific line of a specific file contained in a git repository?

We have a git repository we have been using for many years. Say, it is a Java - maven project. The project has pom.xml file that contains important information like path/to/file/model_version I would like to get…
Keisuke Ueda
  • 185
  • 9
0
votes
0 answers

Release hash of a repo does not show in its "git log"

To mine repositories. I'm basically traversing its git commits to extracting info. However, in many repositories, I see that the hash of a release is not present in the git log. For example in project bitcoin, the hash of release v0.19.0.1 is…
0
votes
0 answers

How can I calculate commit size difference of each commit in python?

For example consider a git repository having 5 commits with size 1Mb, 2Mb, 2.5Mb, 3Mb and 2Mb at each of the commits. I wish to obtain the difference of each commit size in python. That is 1Mb, 1Mb, 0.5Mb, 0.5Mb, -1Mb. Is there any way or command in…
Tavish Jain
  • 155
  • 1
  • 2
  • 13
0
votes
1 answer

apparently equal strings are not equal in Python

I am writing a prepush githook using GitPython. Here is a snippet of code: local_ref, local_sha1, remote_ref, remote_sha1 = [line for line in sys.stdin][0].split(' ') for i, commit in enumerate(repo.iter_commits('docs-and-config')): …
Katie
  • 808
  • 1
  • 11
  • 28
0
votes
1 answer

How to use --force-with-lease with (GitPython) git.remote.Remote?

I am trying to be Pythonic. Thus, I have this code: import git import uuid repo = git.Repo(...) u = repo.create_remote(uuid.uuid4(), 'https://github.com/...') If I wasn't trying to be pythonic, I could do this: repo.git.push(u.name, refspec,…
Matthew
  • 2,593
  • 22
  • 25
0
votes
1 answer

GitPython: retrieve changed files between commits in specific sub directory

The repo structure looks like this: - folder_a - folder_b - folder_c - ... I am particularly interested in the files that changed in a specific commit, but only the ones in folder_a. My solution is for filename, details in…
idailylife
  • 174
  • 2
  • 14
0
votes
0 answers

GitPython to get Github repositories status

I am working on a project where I want to get the status of my private Github repository using python and as per the status I want blink the LED on the raspberry pi3 module...For example if the commit is failed then LED turns red and if commit is…
bjn27
  • 1
  • 1
0
votes
1 answer

How to get the diff between two hashes in gitpython

At the command line I can do git diff --name-only to enumerate all the changed files. How would I do this in gitpython?
jxramos
  • 7,356
  • 6
  • 57
  • 105
0
votes
2 answers

Git Python log with grep

On command line I am running git log \ --merges \ --grep='^Merge pull request .* in repo/foo from' \ --grep='^Merged .* to master' \ tag1..tag2 This gives me a list of merge commits to master between the two given tags. Now I am…
Hubert Grzeskowiak
  • 15,137
  • 5
  • 57
  • 74
0
votes
1 answer

How to get staged diffs for commit?

I want to obtain a list of differences that are staged for commit (basically the equivalent of "git diff --cached"). I'm using gitpython. I have found that I can get a list of staged files easily enough, but as soon as I request generation of a…
ScottB
  • 1
  • 1
0
votes
1 answer

How to do a quick "pull-merge" in gitpython?

EDIT: this was edited because I made a mistake in the example. Assume I have a very simple git structure: A single remote branch, called "brem" A local, called "bloc" self._repo = git.Repo(args.full_path_to_repo) Having made a change to a bloc,…
Gulzar
  • 23,452
  • 27
  • 113
  • 201