1
0
Fork 0
mirror of https://github.com/clockfort/GitHub-Backup.git synced 2025-03-16 00:00:06 +01:00
GitHub-Backup/README.markdown

102 lines
3.2 KiB
Markdown
Raw Normal View History

2010-07-13 14:20:48 -04:00
GitHub-Backup
2014-06-26 00:28:35 +02:00
============================
2010-07-13 14:20:48 -04:00
Description
2014-06-26 00:28:35 +02:00
----------------------------
2014-06-26 00:28:35 +02:00
GitHub-Backup makes a local backup copy of all of a github user's (or github organization's) repositories.
2010-07-13 14:20:48 -04:00
2013-08-02 00:18:43 +02:00
Dependencies
2014-06-26 00:28:35 +02:00
----------------------------
2013-08-02 00:18:43 +02:00
GitHub-Backup requires `pygithub3` a Python library for the GitHub API v3.
Installation is simple with
2019-05-05 02:07:57 +02:00
pip install -r requirements.txt
2013-08-02 00:18:43 +02:00
2010-07-13 14:33:45 -04:00
Usage
2014-06-26 00:28:35 +02:00
----------------------------
2019-05-05 02:07:11 +02:00
````
usage: github-backup.py [-h] [-c] [-m] [-f] [-S] [-g ARGS] [-o ORG] [-s SUFFIX] [-P PREFIX]
[-p PASSWORD] [-t TOKEN] username backupdir
makes a backup of all of a github user's repositories
positional arguments:
username A Github username
backupdir The folder where you want your backups to go
optional arguments:
2017-08-29 13:22:47 +02:00
-h, --help Show this help message and exit
-c, --cron Use this when running from a cron job
-m, --mirror Create a bare mirror
2016-07-22 12:24:42 +02:00
-f, --skip-forks Skip forks
2014-06-26 00:28:35 +02:00
-S, --ssh Use SSH protocol
-g ARGS, --git ARGS Pass extra arguments to git
2017-08-29 13:22:47 +02:00
-o ORGANIZATION, --organization ORGANIZATION
Backup Organizational repositories
-p PASSWORD, --password PASSWORD
Authenticate with Github API
-P PREFIX, --prefix PREFIX
Add prefix to repository directory names
-s SUFFIX, --suffix SUFFIX
Add suffix to repository directory names
2014-06-26 00:28:35 +02:00
-p PASSWORD, --password PASSWORD
Authenticate with Github API using OAuth token
2014-06-26 00:28:35 +02:00
-t TOKEN, --token TOKEN
OAuth token for authentification
-o ORG, --organization ORG
Backup Organizational repositories
````
2010-07-13 14:33:45 -04:00
Then, put it in a cron job somewhere and forget about it for eternity.
How To Back Up Entire GitHub Organisation Repos
-------------------------
1. Install Dependencies: `sudo pip install pygithub3]
2. Clone this repo using [git clone https://github.com/clockfort/GitHub-Backup.git
3. Just open the cloned repo folder and run the terminal:
```
./github-backup.py [Your GitHub Username] [Path To Saving Directory] -o [For Organisation]
```
Example:
```
./github-backup.py mohamed786 /home/mohamed786/githubbak -o LineageOS
```
2010-07-13 14:33:45 -04:00
Why This Software Exists
-------------------------
This software is useful in many cases:
2010-07-13 14:26:01 -04:00
- GitHub suddenly explodes.
- GitHub goes out of business.
- Your corporation's backup policies are more stringent than GitHub's.
- You have spotty/no internet access - perhaps you'd like to have all of your repositories available to code on while you ride the train?
- You are paranoid tinfoil-hat wearer who needs to back up everything in triplicate on a variety of outdated tape media.
2010-07-13 14:20:48 -04:00
Questions, Improvements, Etc
-----------------------------
If you have any improvements, I'm happy, (grateful, in fact) to entertain pull requests/patches, just drop me a line or message me on GitHub.
2014-06-26 00:28:35 +02:00
Contributors
----------------------------
Idea/original implementation by
- Chris Lockfort (clockfort@csh.rit.edu) (Github: Clockfort)
(Original idea)
- Anthony Gargiulo (anthony@agargiulo.com) (Github: agargiulo)
(Python version)
- Steffen Vogel (post@steffenvogel.de) (Github: stv0g)
(A lot of patches and improvements)