Skip to content

Commit 72fa5d3

Browse files
authored
Merge pull request #510 from Changaco/documentation-improvements
Documentation improvements
2 parents c5d11c0 + 8e76089 commit 72fa5d3

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

README.rst

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Using PIP via PyPI::
2222
Using PIP via Github (more likely the latest version)::
2323

2424
pip install git+https://github.com/josegonzalez/python-github-backup.git#egg=github-backup
25-
25+
2626
*Install note for python newcomers:*
2727

2828
Python scripts are unlikely to be included in your ``$PATH`` by default, this means it cannot be run directly in terminal with ``$ github-backup ...``, you can either add python's install path to your environments ``$PATH`` or call the script directly e.g. using ``$ ~/.local/bin/github-backup``.*
@@ -249,7 +249,7 @@ Note: When you run github-backup, you will be asked whether you want to allow "
249249
Github Rate-limit and Throttling
250250
--------------------------------
251251

252-
"github-backup" will automatically throttle itself based on feedback from the Github API.
252+
"github-backup" will automatically throttle itself based on feedback from the Github API.
253253

254254
Their API is usually rate-limited to 5000 calls per hour. The API will ask github-backup to pause until a specific time when the limit is reset again (at the start of the next hour). This continues until the backup is complete.
255255

@@ -325,7 +325,12 @@ Gotchas / Known-issues
325325
All is not everything
326326
---------------------
327327

328-
The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
328+
The ``--all`` argument does not include: downloading attachments from issue and pull request comments (``--attachments``), cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
329+
330+
Saves nothing if no arguments are passed
331+
----------------------------------------
332+
333+
At least one argument like ``--all`` or ``--repositories`` is needed for github-backup to actually save data. Without relevant arguments, github-backup fetches some data from GitHub but doesn't put any of it into files.
329334

330335
Starred repository size
331336
-----------------------
@@ -363,9 +368,9 @@ This means any blocking errors on previous runs can cause missing data in backup
363368

364369
Using (``--incremental-by-files``) will request new data from the API **based on when the file was modified on filesystem**. e.g. if you modify the file yourself you may miss something.
365370

366-
Still saver than the previous version.
371+
Still safer than the previous version.
367372

368-
Specifically, issues and pull requests are handled like this.
373+
Incremental backup only changes how issue and pull request data is fetched.
369374

370375
Known blocking errors
371376
---------------------
@@ -429,27 +434,27 @@ Github Backup Examples
429434

430435
Backup all repositories, including private ones using a classic token::
431436

432-
export ACCESS_TOKEN=SOME-GITHUB-TOKEN
437+
ACCESS_TOKEN=SOME-GITHUB-TOKEN
433438
github-backup WhiteHouse --token $ACCESS_TOKEN --organization --output-directory /tmp/white-house --repositories --private
434439

435440
Use a fine-grained access token to backup a single organization repository with everything else (wiki, pull requests, comments, issues etc)::
436441

437-
export FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
442+
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
438443
ORGANIZATION=docker
439444
REPO=cli
440445
# e.g. git@github.com:docker/cli.git
441446
github-backup $ORGANIZATION -P -f $FINE_ACCESS_TOKEN -o . --all -O -R $REPO
442447

443448
Quietly and incrementally backup useful Github user data (public and private repos with SSH) including; all issues, pulls, all public starred repos and gists (omitting "hooks", "releases" and therefore "assets" to prevent blocking). *Great for a cron job.* ::
444449

445-
export FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
450+
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
446451
GH_USER=YOUR-GITHUB-USER
447452

448453
github-backup -f $FINE_ACCESS_TOKEN --prefer-ssh -o ~/github-backup/ -l error -P -i --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --security-advisories --discussions --repositories --wikis --releases --assets --attachments --pull-details --gists --starred-gists $GH_USER
449-
454+
450455
Debug an error/block or incomplete backup into a temporary directory. Omit "incremental" to fill a previous incomplete backup. ::
451456

452-
export FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
457+
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
453458
GH_USER=YOUR-GITHUB-USER
454459

455460
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --discussions --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER

github_backup/github_backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def parse_args(args=None):
480480
"--attachments",
481481
action="store_true",
482482
dest="include_attachments",
483-
help="download user-attachments from issues, pull requests, and discussions",
483+
help="download user-attachments from issues, pull requests, and discussions [*]",
484484
)
485485
parser.add_argument(
486486
"--throttle-limit",

0 commit comments

Comments
 (0)