All Questions
34 questions
0
votes
0
answers
139
views
Clone ssh git repositories using python 3
I have this Python Script that clones a list of length n of repositories using ssh.
import pandas as pd
import time
import git
import sys
import os
counter = 0
#excel reader
resources = pd....
0
votes
1
answer
97
views
Why gitpython results doesn't match to the github website?
I use the following python code to extract the diff (the hunks) between two commits.
from git import Repo
!git clone https://github.com/apache/commons-math.git
repo = Repo("/content/commons-math&...
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 ...
0
votes
1
answer
233
views
Python PyTest running GitPython under Tox in Ubuntu Docker image: commit fails with Committer/Author identity unknown
Q+A (I'm posting this in case someone else goes down this niche rabbit hole - as it took me a while to figure this out).
Scenario:
You've decided to run a unit-test which 'plays' with creating a local ...
0
votes
1
answer
608
views
Why latest commit date is not working in Github workflow?
This code is used to get the latest commit date of a GitHub file in a folder. This is working in my local machine but not working in Github action. In the Github action, it's giving the same date for ...
6
votes
2
answers
3k
views
How to get master/main branch from gitpython
How one can know about the master/main branch at git remote with git-python.
I am aware that we can iterate over the heads of the repository and then check the results. Something like
repo = git.Repo('...
0
votes
1
answer
928
views
Why I get different time zone in PostgreSQL [closed]
I am extracting data from GitHub into my database (PostgreSQL) using git in python.
I tried to extract DateTime by using committed_datetime and insert this data into my database; what happens that I ...
0
votes
0
answers
1k
views
AttributeError: 'Repo' object has no attribute 'create_pull'
I'm currently running the following python script. The intention is to be able to automatically create a PR.
if new_repo != None: #if there are files within the repo
current = new_repo....
4
votes
0
answers
1k
views
gitpython: How to authenticate as a Github app?
When I do
remote = f"https://{username}:{password}@github.com/user/repo"
git.Repo.clone_from(remote, 'repo')
I get to clone the repository with my personal credentials.
But if I try an app ...
0
votes
0
answers
439
views
Error for git branch command using GitPython?
So I am using GitPython in a script to get the start branch of a commit. It works for some, but for others I eventually get errors like these:
[10] => Failed to process commit: Cmd('git') failed ...
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]&...
3
votes
2
answers
1k
views
How (and why) upgrade a GitHub workflow to use “Environment files”
I have a GitHub action workflow file that is running fine, but recently warnings about ‘set-env’ and ‘add-path’ deprecation have been brought to my attention. The fix suggested by GitHub is to use “...
0
votes
1
answer
1k
views
gitpython's clone_from() throws exceptions while cloning a repo when called through an flask API
I have python snippet which clones a github repo over https access tokens, creates a branch modifies the content, and pushes back. Below code works perfectly fine if run directly via python ...
3
votes
1
answer
1k
views
Cloning a repo using GitPython displays "cannot pread pack file: No such file or directory error"
I am cloning a repository from GitHub onto a databricks dbfs location using GitPython as follows:
outdir = "dbfs:/tmp/project"
repo = Repo.clone_from('https://<github token>@github.com/xyz/...
-1
votes
1
answer
44
views
Commits from branch master appear in other branch - GitHub
I am analyzing commits from project apache/mina-sshd but I am running to a problem:
All commits in the branch 0.9.x from project mina-sshd (except for the first 3 commits) belongs to branch master ...