Skip to content

Instantly share code, notes, and snippets.

@notriddle
Last active May 6, 2023 08:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save notriddle/6c232ed0691dc77cc8a3adc10b4e2aaf to your computer and use it in GitHub Desktop.
Save notriddle/6c232ed0691dc77cc8a3adc10b4e2aaf to your computer and use it in GitHub Desktop.
The hub workflow

How to use hub's PAT for user accounts

$ git config --global hub.protocol https
$ cat ~/.config/hub
github.com:
- user: notriddle
  oauth_token: [CENSORED]
  protocol: https
$ cat > ~/.netrc
machine github.com
login notriddle
password [CENSORED]
$ chmod 600 ~/.netrc

How to use hub once it's set up

$ hub clone janitortechnology/janitor # Unless you're in Janitor, in which case you already have one
Cloning into 'janitor'...
remote: Counting objects: 1797, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 1797 (delta 21), reused 25 (delta 11), pack-reused 1750
Receiving objects: 100% (1797/1797), 1.03 MiB | 1.49 MiB/s, done.
Resolving deltas: 100% (1234/1234), done.
Checking connectivity... done.
$ cd janitor
$ hub fork
Updating notriddle
From https://github.com/JanitorTechnology/janitor
 * [new branch]      master     -> notriddle/master
new remote: notriddle
$ git checkout -b tweak_readme
$ c9 README.md
$ git add README.md
$ git commit -m "Add hub to the README"
$ git push -u notriddle HEAD
$ hub pull-request
https://github.com/JanitorTechnology/janitor/pull/88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment