All Questions
15 questions
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
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 ...
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]&...
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 ...
1
vote
0
answers
876
views
Clone a specific directory from git repo using Git-Python
My git repo is of more than 2GB in size. I need to clone this repo locally via python and do some updates to it. It is just enough if I clone a particular directory in it.
How to accomplish this with ...
1
vote
1
answer
3k
views
How to checkout and merge branches to master - GITPYTHON
I need to merge all my branches to the master using python. branch local path,buildno getting via environment variables. I have the following code to checkout each branch and merge to master. but it ...
1
vote
1
answer
4k
views
Git pull using GitPython + SSH keys doesn't work
I am trying to pull a repo from my Github account using GitPython. This is after
(1) I performed a git clone already from the command line.
(2) Generated new SSH keys using
ssh-keygen -t rsa -b ...
1
vote
1
answer
3k
views
How can I use gitpython to run 'git pull alias_name master' where alias_name is a custom alias?
I am relatively new to Python and am attempting to use GitPython to pull changes down from a remote repository to its local counterpart that has already been cloned.
Outside of the script, running '...
0
votes
1
answer
302
views
Getting the time when the file was committed on Github
I want to somehow want to see if there is a way to get the time for when a file was committed on Github. I have tried using PyGithub and GitPython, but they don't have any options as such. Does anyone ...
4
votes
2
answers
4k
views
Get GitHub username from commit history
I cloned a repo to my machine, and did
git log
but in the logs, it shows the persons full name and email, rather than their github username.
Is there a way to associate the commits to a user ...
2
votes
0
answers
277
views
Any git hook to block merge conflict?
I am planning to write a git hook in python to protect my github repository. It will detect merge conflict markers (like >>>>>>) and block the commit.
I have some initial ideas but ...
1
vote
1
answer
3k
views
What's the difference between gitpython's diff and git log's diff?
I don't understand the difference between the output of git log -p and that of gitpython in terms of diffs.
For example, for some merge commit f534e1..., git log -p gives:
commit f534e1...
Merge: ......