Using GitHub’s .gitignore, I was able to filter out some files and directories. However, there’s a few things that left me a little bit confused: GitHub’s .gitignore did not include /bin and /share created by venv. I assumed they should be ignored by git, however, as the user is meant to build the virtual environment […]
I am missing a key piece of understanding regarding the workflow needed to contribute to larger open source projects on the GitHub platform, and I am hoping someone may be able to explain. Essentially, I’d like to understand how to contribute to the scikit-learn repository. I am clear on how to fork the repo, update […]
I have a repo created via GitPython library that has some uncommitted changes. I want to stash those changes. How do I do it? Searching for “stash” in the GitPython docs returned no results.
In my python program, I want to check whether a ref exists on my remote. I can check the remote with git ls-remote, but I would like to avoid parsing the output myself. I found git.remote.Remote in GitPython, but that only refers to a remote of a local repository. Does GitPython have an equivalent command […]
I didn’t succeed installing the latest airflow release candidate. Specifically, running pip install -e git://email@example.com#egg=airflow on the CL ended with: File “/home/alex/Desktop/urban-physiology-toolkit/src/airflow/setup.py”, line 87, in git_version assert tag == version, (tag, version) AssertionError: (‘1.8.2rc4’, ‘1.8.2’) Followed by the usual pip FAIL redtext. The offending code line is a tag version check. Installing from HEAD works […]
I’m trying to catch a very simple error, but with no result for now. I’ve created a tag on my Git repository and trying to catch an error with the creation of existing tag. My code looks like: try: check_call([‘git’, ‘tag’, ‘-a’, ‘1.2.3’, ‘-m’, ‘test tag.’]) except CalledProcessError as err: print err.output, err.returncode, err.message I […]
I’m trying to get the message from a git add command, to print to a log file later on. import subprocess import os filename = ‘test.txt’ # Add changes add_cmd = “””git add “%s” “”” % filename os.system(add_cmd) a = subprocess.check_output(add_cmd, shell=True, stderr=subprocess.STDOUT) The os.system() call shows in screen: fatal: Not a git repository (or […]
I am trying to script a git pull without having to enter a username and password. How would I go about doing this? The only functionality I will be using from git is “git pull”.
I need author name and last commit time for a specified file with python. Currentrly, I’m trying to use dulwich. There’re plenty of apis to retrieve objects for a specific SHA like: repo = Repo(“myrepo”) head = repo.head() object = repo.get_object(head) author = object.author time = object.commit_time But, how do i know the recent commit […]
I use repo-1.19: $ wget -nv ‘http://code.google.com/p/git-repo/downloads/detail?name=repo-1.19’ 2013-08-05 02:36:32 URL:http://code.google.com/p/git-repo/downloads/detail?name=repo-1.19  -> “detail?name=repo-1.19.3”  $ chmod +x repo-1.19 $ ./repo-1.19 –version repo version v1.12.2 (from https://gerrit.googlesource.com/git-repo) repo launcher version 1.19 (from /home/u/Téléchargements/repo-1.19) git version 184.108.40.206 Python 2.7.4 (default, Jul 5 2013, 08:21:57) [GCC 4.7.3] But when I try to initialize it I have the Python […]