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
3 answers

Git repository cloning with GitPython - repository not found Authentication Failed

I am trying to clone private repository using Python. I am using Git Python package to clone the repository but I am getting an error: Error : GitCommandError: 'git clone -v https://github.mit.edu/mitx/content-mit-1690rgit edxcourse' returned…
farha
  • 13
  • 5
0
votes
1 answer

How can I wait for a git clone to finish in GitPython

I am cloning from local network using the code below: _g = cmd.Git(clone_path) path = os.path.normcase(os.path.normpath(path)) path = path.replace('\\', '/') _g.clone("-o" + host, "http://" + host + ':8002' + '/' + path + '/' + '.git', …
Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
0
votes
1 answer

GitPython returns exit status of 1 when trying to commit

I am attempting to automatically push changes to data files to a git repository. This script lives in the same repository as the modified data files. Below is a simple example of what I'm attempting. (For this example, replacing the word "cake" with…
Andy
  • 49,085
  • 60
  • 166
  • 233
0
votes
1 answer

get dictionary of files and directories from git repository

I'm trying to get dictionary of directories and files from git repository like this: {"dir1": ["file1", "file2", "dir2", "dir3"], "dir2": {"file3", "dir4"}} I know how to get list of files, the problem is how to transform it into dictionary like…
ivknv
  • 305
  • 1
  • 4
  • 14
0
votes
1 answer

Retrieving versions of a file

Say I have a path to a git repository in the local filesystem: path_to_my_repository, and a path to a file in the repository path_to_file. For a given list of dates, how can I get the corresponding version of the file on a particular branch from…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
0
votes
1 answer

GitPython - cannot get index for repo?

How on earth does one get the index for a repos using GitPython ? import git repo = git.Repo.init('/path/to/repos/') ... add some files ... ... commit ... index = repo.index() Throw error: 'Repo' object has no attribute 'index' WTH? My eyes are…
RSAdmin
  • 419
  • 1
  • 6
  • 20
0
votes
1 answer

OSError: [Errno 2] No such file or directory on GitPython

I am using GitPython to fetch a remote repository to my machine. The following code works well on my Ubuntu 12.04 but on my amazon ec2, on a Ubuntu 11.10 server, I get the OSError: [Errno 2] No such file or directory error. repo =…
masnun
  • 11,635
  • 4
  • 39
  • 50
-1
votes
1 answer

Is it possible to emulate `git add -A` in GitPython?

I've recently discovered GitPython, and, given that I'm currently trying to create a Python script which pushes to and pulls from Git repositories automatically, I was really excited to try it out. When committing to a repository using command line…
Tom Hosker
  • 526
  • 2
  • 17
-1
votes
1 answer

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 but still be shown in branch 0.9.x. Can anyone…
-1
votes
1 answer

Python 3.5.1: Unable to install gitpython package using pip

I want to issue the Git command git pull from Python script to get the files from Git and update my local folders. For this I am trying to install gitpython package in my machine. Python Version used is 3.5.1 OS is Winoows 10 The following two…
ArtBajji
  • 949
  • 6
  • 14
-1
votes
2 answers

Python - how to check whether the path is under a git repo? and extract the repo name

I'm trying to develop a Gatekeeping script in python rollin.py with the following requirements: Assume user would launch the rollin.py script from anywhere within his local git cloned area to push his commits to the master repo Now, rollin.py…
Kranti
  • 1
  • 1
  • 2
-1
votes
2 answers

call python code of different git branch other than the current repository without switching branch

So, basically I have 2 versions of a project and for some users, I want to use the latest version while for others, I want to use older version. Both of them have same file names and multiple users will use it simultaneously. To accomplish this, I…
proprius
  • 502
  • 9
  • 20
-2
votes
2 answers

Python: sorted - not sorting gitPython branch objects by default?

I have this method: def filter_branches_by_names(self, names, exclude=False): """Filter branches list using names list. Args: names (list): names list to use as filter condition. exclude (bool): If set to False,…
Andrius
  • 19,658
  • 37
  • 143
  • 243
-3
votes
1 answer

GitPython get list of commits from a repo-branch

I have a Git repository URL and a branch name. Using GitPython how do I get all the commits from the branch?
intrigued_66
  • 16,082
  • 51
  • 118
  • 189
-4
votes
1 answer

I would like to ask how to solve this problem

Traceback (most recent call last): File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 83, in refresh() File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 73, in refresh if not…
1 2 3
32
33