The repo can be installed directly as a python package. We recommend installing it either using pipx (recommended) or using a bare virtualenv to avoid polluting your python installation. You should ensure you are logged into github for https access through saml using either the github credentials manager or allowing your ssh key for organization access and changing the git urls in these instructions to [email protected]:uiuc-csid/git-archiver.git.
Pipx is a useful tool that allows you to install command line tools into isolated virtual environments while automatically creating and managing them. It also places scripts onto the user's path so that they do not have to activate the venv by hand each time they want to use the command. Because of this, it is the recommended method for installing small scripts like this.
After installing pipx following the instructions here you can install the package in an isolated virtual environment with a single command
pipx install git+https://github.com/uiuc-csid/git-archiver.git
git-archiver <options>Find a suitable place on your machine and create a virtual environment using python -m venv $VENV-LOCATION.
Then activate the virtual environment and install the package. Note: you will need to activate the virtual environment before each time you use the script in order to put it on your path.
source $VENV-LOCATION/bin/activate
pip install git+https://github.com/uiuc-csid/git-archiver.git
git-archiver <options>You will need to generate a personal access token for github. For github-dev the link is here. It should have repo level permissions.
In order to archive an organization, you must first ensure that you are the owner of the organization. Then, create an empty folder and cd into it. We recommend that you name this folder after the organization that you are archiving. Now you can call git-archiver and it will clone every repo from the organization as a bare repo into the current folder. All options can be set either interactively, as cli flags, or as environment variables.
| Argument | Environment variable | Purpose |
|---|---|---|
| --github-base-url | GITHUB_BASE_URL | The api url you are using. Defaults to https://github-dev.cs.illinois.edu/api/v3 |
| --github-token | GITHUB_TOKEN | Your personal access token |
| --github-org-name | GITHUB_ORG_NAME | The organization you are archiving |
mkdir test-org
export GITHUB_TOKEN=************
git-archiver --github-org-name test-org