Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tsai-jimmy/aa4434879f03e6684e24b80958d63237 to your computer and use it in GitHub Desktop.

Select an option

Save tsai-jimmy/aa4434879f03e6684e24b80958d63237 to your computer and use it in GitHub Desktop.

Revisions

  1. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-gh-cli-auth-2fa.md
    Original file line number Diff line number Diff line change
    @@ -48,4 +48,4 @@ These are instructions for setting up git to authenticate with GitHub when you h
    You should NOT be asked for your username and password, instead you should see `Everything up-to-date`.
    Rejoice and close the shell.
    Rejoice and close the shell. If your test repository isn't important, you can delete it from the bcgov GitHub account.
  2. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions setup-gh-cli-auth-2fa.md
    Original file line number Diff line number Diff line change
    @@ -23,9 +23,9 @@ These are instructions for setting up git to authenticate with GitHub when you h
    4. [Set up a personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use) for accessing GitHub repositories - I recommend giving it `gist`, `repo`, and `user` scope. *Make sure you copy the token now as you won't be able to later*
    5. Create test repository in the bcgov org.
    5. Create a test repository in the [bcgov organization](https://github.com/bcgov).
    6. Clone the repository on the command line:
    6. Clone the repository on the command line (terminal/git bash window):
    ```
    git clone https://github.com/bcgov/[my-test-repo]
    ```
    @@ -39,7 +39,7 @@ These are instructions for setting up git to authenticate with GitHub when you h
    git push -u origin master
    ```
    At this point you'll be asked for your username and password. Enter your username, then in the password prompt *paste your Personal Access Token you created in step 3*. (Note: in the windows git bash shell, paste with Shift+Insert or right-click -> paste)
    At this point you'll be asked for your username and password. Enter your username, then in the password prompt *paste your Personal Access Token you created in step 3*. (Note: in the Windows git bash shell, paste with Shift+Insert or right-click -> paste)
    9. Now push AGAIN.
    ```
  3. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions setup-gh-cli-auth-2fa.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

    1. Download and install the [git command-line client](https://git-scm.com/download)
    1. Download and install the [git command-line client](https://git-scm.com/download) (if required).

    2. Open the git bash window and [Introduce yourself to git](http://happygitwithr.com/hello-git.html):
    2. Open the git bash window and [introduce yourself to git](http://happygitwithr.com/hello-git.html) (if required):

    ```
    git config --global user.name 'Firstname Lastname'
  4. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions setup-gh-cli-auth-2fa.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using.
    These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

    1. Download and install the [git command-line client](https://git-scm.com/download)

    @@ -11,12 +11,12 @@ These are instructions for setting up git to authenticate with GitHub when you h
    3. Turn on the credential helper to cache your credentials (so you only need to do this once):
    a. Windows ([more detailed instructions here](https://help.github.com/articles/caching-your-github-password-in-git/#platform-windows):
    a. Windows ([more detailed instructions here](https://help.github.com/articles/caching-your-github-password-in-git/#platform-windows)):
    ```
    git config --global credential.helper wincred
    ```
    b. Mac ([more detailed instructions here](https://help.github.com/articles/caching-your-github-password-in-git/#platform-mac):
    b. Mac ([more detailed instructions here](https://help.github.com/articles/caching-your-github-password-in-git/#platform-mac)):
    ```
    git config --global credential.helper osxkeychain
    ```
  5. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setup-gh-cli-auth-2fa.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@ These are instructions for setting up git to authenticate with GitHub when you h
    ```
    3. Turn on the credential helper to cache your credentials (so you only need to do this once):
    a. Windows ([more detailed instructions here](https://help.github.com/articles/caching-your-github-password-in-git/#platform-windows):
    ```
    git config --global credential.helper wincred
  6. @ateucher ateucher renamed this gist Feb 14, 2017. 1 changed file with 0 additions and 0 deletions.
  7. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions setup-gh-cli-auth-2fa-win.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    These are instructions for setting up git on your Windows machine to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using.
    These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using.

    1. Download and install the [git command-line client](https://git-scm.com/download/win)
    1. Download and install the [git command-line client](https://git-scm.com/download)

    2. Open the git bash window and [Introduce yourself to git](http://happygitwithr.com/hello-git.html):

    @@ -10,9 +10,15 @@ These are instructions for setting up git on your Windows machine to authenticat
    ```
    3. Turn on the credential helper to cache your credentials (so you only need to do this once):
    a. Windows ([more detailed instructions here](https://help.github.com/articles/caching-your-github-password-in-git/#platform-windows):
    ```
    git config --global credential.helper wincred
    ```
    b. Mac ([more detailed instructions here](https://help.github.com/articles/caching-your-github-password-in-git/#platform-mac):
    ```
    git config --global credential.helper osxkeychain
    ```
    4. [Set up a personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use) for accessing GitHub repositories - I recommend giving it `gist`, `repo`, and `user` scope. *Make sure you copy the token now as you won't be able to later*
  8. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-gh-cli-auth-2fa-win.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ These are instructions for setting up git on your Windows machine to authenticat
    git config --global credential.helper wincred
    ```
    4. Set up a [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use) for accessing GitHub repositories - I recommend giving it `gist`, `repo`, and `user` scope. *Make sure you copy the token now as you won't be able to later*
    4. [Set up a personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use) for accessing GitHub repositories - I recommend giving it `gist`, `repo`, and `user` scope. *Make sure you copy the token now as you won't be able to later*
    5. Create test repository in the bcgov org.
  9. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-gh-cli-auth-2fa-win.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ These are instructions for setting up git on your Windows machine to authenticat
    git config --global credential.helper wincred
    ```
    4. Set up a [personal access token for github](https://help.github.com/articles/creating-an-access-token-for-command-line-use) - I recommend giving it `gist`, `repo`, and `user` scope. *Make sure you copy the token now as you won't be able to later*
    4. Set up a [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use) for accessing GitHub repositories - I recommend giving it `gist`, `repo`, and `user` scope. *Make sure you copy the token now as you won't be able to later*
    5. Create test repository in the bcgov org.
  10. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-gh-cli-auth-2fa-win.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ These are instructions for setting up git on your Windows machine to authenticat

    1. Download and install the [git command-line client](https://git-scm.com/download/win)

    2. [Introduce yourself to git](http://happygitwithr.com/hello-git.html):
    2. Open the git bash window and [Introduce yourself to git](http://happygitwithr.com/hello-git.html):

    ```
    git config --global user.name 'Firstname Lastname'
  11. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-gh-cli-auth-2fa-win.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ These are instructions for setting up git on your Windows machine to authenticat
    git config --global user.email '[email protected]'
    ```
    3. Turn on the credential helper to cache your credentials:
    3. Turn on the credential helper to cache your credentials (so you only need to do this once):
    ```
    git config --global credential.helper wincred
    ```
  12. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-gh-cli-auth-2fa-win.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    These are instructions for setting up git on your Windows machine to authenticate with GitHub when you have 2-factor authentication set up.
    These are instructions for setting up git on your Windows machine to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using.

    1. Download and install the [git command-line client](https://git-scm.com/download/win)

  13. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion setup-gh-cli-auth-2fa-win.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    These are instructions for setting up git on your Windows machine to authenticate with GitHub when you have 2-factor authentication set up.

    1. Download and install the [git command-line client](https://git-scm.com/download/win)

    2. [Introduce yourself to git](http://happygitwithr.com/hello-git.html):
    @@ -12,7 +14,7 @@
    git config --global credential.helper wincred
    ```
    4. Set up a [personal access token for github](https://help.github.com/articles/creating-an-access-token-for-command-line-use) - I recommend giving it gist, repo, and user scope. *Make sure you copy the token now as you won't be able to later*
    4. Set up a [personal access token for github](https://help.github.com/articles/creating-an-access-token-for-command-line-use) - I recommend giving it `gist`, `repo`, and `user` scope. *Make sure you copy the token now as you won't be able to later*
    5. Create test repository in the bcgov org.
  14. @ateucher ateucher renamed this gist Feb 14, 2017. 1 changed file with 0 additions and 0 deletions.
  15. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions setup-gh-sli-auth-2fa.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,11 @@
    1. Download and install the [git command-line client](https://git-scm.com/download/win)

    2. [Introduce yourself to git](http://happygitwithr.com/hello-git.html)
    2. [Introduce yourself to git](http://happygitwithr.com/hello-git.html):

    ```
    git config --global user.name 'Firstname Lastname'
    git config --global user.email '[email protected]'
    ```
    3. Turn on the credential helper to cache your credentials:
    ```
    @@ -16,7 +21,7 @@
    git clone https://github.com/bcgov/[my-test-repo]
    ```
    7. Make any change you want in your local repository. Eg., make or edit a README.md file
    7. Make any change you want in your local repository. Eg., make or edit your `README.md` file.
    8. Add, commit, and push your changes:
    ```
  16. @ateucher ateucher revised this gist Feb 14, 2017. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions setup-gh-sli-auth-2fa.md
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    2. [Introduce yourself to git](http://happygitwithr.com/hello-git.html)

    3. Turn on the credential helper to cache your credentials:
    ```
    git config --global credential.helper wincred
    ```
    ```
    git config --global credential.helper wincred
    ```
    4. Set up a [personal access token for github](https://help.github.com/articles/creating-an-access-token-for-command-line-use) - I recommend giving it gist, repo, and user scope. *Make sure you copy the token now as you won't be able to later*
    @@ -28,9 +28,10 @@ git config --global credential.helper wincred
    At this point you'll be asked for your username and password. Enter your username, then in the password prompt *paste your Personal Access Token you created in step 3*. (Note: in the windows git bash shell, paste with Shift+Insert or right-click -> paste)
    9. Now push AGAIN.
    ```
    git push
    ```
    You should NOT be asked for your username and password, instead you should see `Everything up-to-date`.
    ```
    git push
    ```
    You should NOT be asked for your username and password, instead you should see `Everything up-to-date`.
    Rejoice and close the shell.
    Rejoice and close the shell.
  17. @ateucher ateucher created this gist Feb 14, 2017.
    36 changes: 36 additions & 0 deletions setup-gh-sli-auth-2fa.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    1. Download and install the [git command-line client](https://git-scm.com/download/win)

    2. [Introduce yourself to git](http://happygitwithr.com/hello-git.html)

    3. Turn on the credential helper to cache your credentials:
    ```
    git config --global credential.helper wincred
    ```

    4. Set up a [personal access token for github](https://help.github.com/articles/creating-an-access-token-for-command-line-use) - I recommend giving it gist, repo, and user scope. *Make sure you copy the token now as you won't be able to later*

    5. Create test repository in the bcgov org.

    6. Clone the repository on the command line:
    ```
    git clone https://github.com/bcgov/[my-test-repo]
    ```
    7. Make any change you want in your local repository. Eg., make or edit a README.md file
    8. Add, commit, and push your changes:
    ```
    git add README.md
    git commit -m "Edit README"
    git push -u origin master
    ```
    At this point you'll be asked for your username and password. Enter your username, then in the password prompt *paste your Personal Access Token you created in step 3*. (Note: in the windows git bash shell, paste with Shift+Insert or right-click -> paste)
    9. Now push AGAIN.
    ```
    git push
    ```
    You should NOT be asked for your username and password, instead you should see `Everything up-to-date`.
    Rejoice and close the shell.