Skip to content

Commit e623868

Browse files
authored
Merge pull request #1848 from fltfx/fltfx_osx_git_installation
Added information about Mac M1/M2/M3 git installation and Github access token instructions
2 parents f2689ab + 744e784 commit e623868

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

en/deploy/README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,42 @@ To https://github.com/ola/my-first-blog.git
166166
Branch main set up to track remote branch main from origin.
167167
```
168168

169-
> **Note** You might encounter the following error when trying to push to GitHub:
169+
**Note** You will likely encounter the following error when trying to push to GitHub:
170170
```
171171
remote: Support for password authentication was removed on August 13, 2021.
172172
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
173173
fatal: Authentication failed for 'https://github.com/<your-github-username>/my-first-blog.git/'
174174
```
175-
In this case, follow the instructions from GitHub to [create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). The token should have the 'repo' scope. Copy the value of the token, then try the git push command again. When you are prompted to enter your username and password, enter the access token instead of your password.
175+
In this case, follow the instructions from GitHub to [create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). The token should have the 'repo' scope. Copy the value of the token, then try the git push command again. When you are prompted to enter your username and password, enter the access token instead of your password:
176+
177+
1. Go to profile settings or go here: https://github.com/settings/profile
178+
2. Scroll down and click "Developer settings" on left-hand menu or go here: https://github.com/settings/apps
179+
3. On left-hand menu, press "Personal access tokens" to expand the dropdown menu. Click "Tokens (classic)"
180+
4. In the top-right, click "Generate new token", and then click "Generate new token (classic)". You will need to authenticate your account at this point.
181+
5. Fill in the form:
182+
- Note: Django girls blog
183+
- Expiration: No expiration (or if you want more security, choose 90 days)
184+
- Select scopes: Check every box
185+
6. Press "Generate token"
186+
7. Copy the token generated (it's the text string that likely starts with `ghp...`) and store this token somewhere secure as once you close this page, you will lose access to viewing this token and will need to generate a new one if you lose it. For example, you could store it in a password manager or even in a note on your computer.
187+
8. Run the command in the terminal again:
188+
{% filename %}command-line{% endfilename %}
189+
```
190+
$ git push -u origin HEAD
191+
```
192+
9. When the terminal asks for `username`, enter in your github username. Press enter.
193+
10. Next, it will ask for `password`. Do not use your github password as this method of authenticating ("logging in") is deprecated. Copy the token you just generated (either from github or wherever you carefully stored this token) and carefully paste it into the terminal. Note that as you paste or even type into the terminal for the password, nothing will appear (you can't see what you typed) for security reasons (it's designed like this on purpose). Press enter.
194+
11. If that worked, you will see the output as below. If you are unsuccesful, try to run `git push -u origin HEAD` again and make sure that you enter in your github username and the token (as the password) correctly.
195+
196+
{% filename %}command-line{% endfilename %}
197+
```
198+
Counting objects: 6, done.
199+
Writing objects: 100% (6/6), 200 bytes | 0 bytes/s, done.
200+
Total 3 (delta 0), reused 0 (delta 0)
201+
To https://github.com/ola/my-first-blog.git
202+
* [new branch] main -> main
203+
Branch main set up to track remote branch main from origin.
204+
```
176205

177206
<!--TODO: maybe do ssh keys installs in install party, and point ppl who dont have it to an extension -->
178207

en/deploy/install_git.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ Do not forget to restart the command prompt or PowerShell after the installation
1313
<!--sec data-title="Installing Git: OS X" data-id="git_install_OSX"
1414
data-collapse=true ces-->
1515

16-
Download Git from [git-scm.com](https://git-scm.com/) and follow the instructions.
16+
Download Git from [https://git-scm.com/download/mac](https://git-scm.com/download/mac) and follow the instructions.
1717

1818
> **Note** If you are running OS X 10.6, 10.7, or 10.8, you will need to install the version of git from here: [Git installer for OS X Snow Leopard](https://sourceforge.net/projects/git-osx-installer/files/git-2.3.5-intel-universal-snow-leopard.dmg/download)
1919
20+
> It is recommended to install using brew (you may need to install homebrew if you don't already have it):
21+
> ```brew install git```
22+
>
23+
> Please note that some Mac M1/M2/M3 users may have the error `zsh: command not found: brew`. In that case, please follow [this](https://stackoverflow.com/a/66019047) or [this](https://mac.install.guide/homebrew/zsh-command-not-found-brew) to fix the error.
24+
2025
<!--endsec-->
2126

2227
<!--sec data-title="Installing Git: Debian or Ubuntu" data-id="git_install_debian_ubuntu"

0 commit comments

Comments
 (0)