├── .gitignore ├── 1-exercise-solutions ├── lesson-01 │ ├── 1a.md │ ├── 1b.md │ ├── 1c.md │ ├── 1d.md │ ├── 1e.md │ ├── 1f.md │ └── README.md └── lesson-02 │ ├── 2c.md │ ├── 2d.md │ └── README.md └── git-course └── 2-troubleshooting.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode 3 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-01/1a.md: -------------------------------------------------------------------------------- 1 | 1\. Update one of the HTML or CSS files for your website.
2 | 2\. Upload this file to your GitHub repository.
3 |
4 | **Note:** if the file you updated is inside a folder, open that folder in your GitHub repository first, then upload the file. For example, if you have a file called `styles/header.css`, open the `styles` folder in GitHub first, then click Add file > Upload files.
5 |
6 | Screen Shot 2022-04-11 at 12 00 40 AM
7 | This will replace the existing file in the repository with your updated version.
8 |
9 | 3\. Wait a few minutes for GitHub Pages to process the updated file.
10 | After that, your website should be updated. 11 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-01/1b.md: -------------------------------------------------------------------------------- 1 | 1\. Let's say I created this CSS file called `test.css`: 2 | ``` 3 | body { 4 | opacity: 0.3; 5 | } 6 | ``` 7 | 8 | 2\. Upload the new CSS file to the GitHub repository:
9 | Screen Shot 2022-04-11 at 12 00 40 AM
10 | 11 | 3\. To load the new CSS file onto the website, update your HTML file and add a `` inside the `` section. **Note:** if you uploaded the CSS file into a folder in the previous step, the `href` attribute should use the correct file path (for example: `href="folder_name/test.css"`). 12 | 13 | 4\. Upload the updated HTML file to the GitHub repository.
14 | Screen Shot 2022-04-11 at 12 00 40 AM 15 | 16 | 5\. Wait a few minutes for GitHub to process. After that, your website should now be loading the new HTML file. 17 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-01/1c.md: -------------------------------------------------------------------------------- 1 | 1\. Create a new HTML file. For example, create a file called `test.html`: 2 | ``` 3 |

A new HTML file

4 | ``` 5 | 2\. Upload this file to the GitHub repository:
6 | Screen Shot 2022-04-11 at 12 00 40 AM
7 | 8 | 3\. Update the `index.html` of your website and add a link:
9 | ``` 10 | Link 11 | ``` 12 | You can also use the following code to link to the new HTML file:
13 | ``` 14 | Link 15 | ``` 16 | The href attribute above (`href="test.html"`) uses a **filepath**. It follows the same rules as loading CSS files and images: 17 | - `href="test.html"` => links to a file called `test.html` beside the current HTML file that's open in the browser. 18 | - `href="folder1/test.html"` => looks inside `folder1` for a file called `test.html` and links to that file. 19 | 20 | The 2nd option, using a **filepath**, is preferred since it's easier to type and it won't break if the first part of the URL (`https://[your_github_username].github.io/[repository_name]/`) changes. 21 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-01/1d.md: -------------------------------------------------------------------------------- 1 | 1\. Rename the current `index.html` to something else.
2 | 2\. Rename the HTML file created in exercise 1c. to `index.html`.
3 | 3\. Wait a few minutes for GitHub Pages to update. 4 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-01/1e.md: -------------------------------------------------------------------------------- 1 | The HTML file created in 1c. was renamed to `index.html`, so we have a few options for updating the link:
2 | 3 | 1\. Use the full URL in the `href` attribute. 4 | ``` 5 | Link 6 | ``` 7 | 2\. Don't specify a file at the end of the url and it will default to opening `index.html`. 8 | ``` 9 | Link 10 | ``` 11 | 3\. Use a **filepath** to link to `index.html`. 12 | ``` 13 | Link 14 | ``` 15 | 4\. Use a **filepath**, but leave out the filename. 16 | ``` 17 | Link 18 | ``` 19 | **Note:** you might think that if we leave out the file name from `Link`, it will be `Link`. 20 | However, in HTML `href=""` will cause the link to not do anything. Therefore, we use `href="."` 21 | 22 | `.` is a special character that represents the folder that the current HTML file (with the link) is in.
23 | And because we don't specify a file name after `.`, it will default to opening `index.html` in the current folder. 24 | 25 | We will learn more about `.` when we learn about the command line. 26 | 27 | Option 4 above is the preferred option because it's the easiest to type and won't break if the first part of the URL (`https://[your_github_username].github.io/[your_repository_name]`) changes. 28 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-01/1f.md: -------------------------------------------------------------------------------- 1 | You got this! 2 | 3 | Here's the overall process: 4 | 1. Find or create an HTML website you want to practice with. 5 | 2. Make sure your website works on your computer first by opening the HTML file in the browser. 6 | 3. Create a GitHub repository and upload your code to the repository. 7 | 4. Go into the "Settings" of your repository, open the "Pages" tab, and turn on GitHub Pages. 8 | 9 | You can always re-watch the video if you're stuck on a step. Good luck! 10 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-01/README.md: -------------------------------------------------------------------------------- 1 | https://user-images.githubusercontent.com/70604577/162663932-dd92bd84-15b0-429f-9bfb-59d5a7ccb8c0.mp4 2 | 3 | ![Exercises 2](https://user-images.githubusercontent.com/70604577/162664025-77736b74-57d0-4782-8421-b7f0920aabc5.png) 4 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-02/2c.md: -------------------------------------------------------------------------------- 1 | **Find the IPv6 addresses of GitHub Pages** 2 | 3 | 1\. Search "dns lookup ipv6" in Google to find a DNS lookup tool for IPv6 (here's a link to one: https://mxtoolbox.com/IPv6.aspx). 4 | 5 | 2\. Search "[your_github_username].github.io" in the tool and find the IPv6 addresses. 6 | 7 | **Create DNS records for IPv6** 8 | 9 | 3\. In your domain registrar, create AAAA records for each IPv6 address. It should look like this: 10 | Screen Shot 2022-04-11 at 9 27 40 PM 11 | 12 | **Note:** depending on your domain registrar, 13 | - You may need to leave the subdomain value as blank (instead of `@`). 14 | - You might need to manually enter a TTL value of 300 (300 seconds) instead of 5 mins. 15 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-02/2d.md: -------------------------------------------------------------------------------- 1 | You got this! 2 | 3 | Here's the overall process:
4 | 1. In your domain registrar, delete your DNS records. Then go to your domain name in your browser and check that it stopped working. **Note:** depending on your domain registrar, it may take from 5 minutes (on Namecheap) to 48 hours for the DNS changes to take effect so you just have to wait. 5 | 2. Create DNS A records to link your domain name to GitHub Pages' IPv4 addresses.
6 | 3. Create a CNAME record to link the `www` subdomain to GitHub Pages' domain name (`[your_github_username].github.io`). 7 | 5. Create AAAA records to link your domain name to the IPv6 addresses.
8 | 6. When you're done, your DNS records should look something like this (except replaced with your own GitHub Pages domain name): Screen Shot 2022-04-11 at 9 50 01 PM 9 | 10 | Depending on your domain registrar, it could take from 5 minutes to 48 hours for your DNS records to take effect. 11 | 12 | You can re-watch the video if you get stuck at any step. Good luck! 13 | 14 | ### Optional 15 | Some (but not all) domain registrars provide a DNS record called an ALIAS record, which can be used like a CNAME record, except it's for the base domain name (no subdomain). If your domain registrar offers ALIAS records, try deleting your A records and AAAA records and replacing them with an ALIAS record: 16 | 17 | Screen Shot 2022-04-11 at 10 08 43 PM 18 | -------------------------------------------------------------------------------- /1-exercise-solutions/lesson-02/README.md: -------------------------------------------------------------------------------- 1 | ![Exercises 3](https://user-images.githubusercontent.com/70604577/162859954-3972f3c6-081a-411f-8c82-9a2a16e7bf3f.png) 2 | 3 | ![Exercises 4](https://user-images.githubusercontent.com/70604577/162859970-dd3b1cd2-bc11-4889-8201-39d397752834.png) 4 | -------------------------------------------------------------------------------- /git-course/2-troubleshooting.md: -------------------------------------------------------------------------------- 1 | ## Troubleshooting 2 | Below is a list of issues and fixes. 3 | 4 | ## `cd ~/Desktop/git-tutorial` does not work on Windows 5 | 1. Windows introduced OneDrive, which moved the Desktop folder to a different location `~/OneDrive/Desktop` 6 | 2. To open the git-tutorial folder on the desktop, run `cd ~/OneDrive/Desktop/git-tutorial` 7 | 8 | ## Git no longer supports password when using `git push` 9 | 1. When running `git push origin master` or `git push origin main` when entering your password, you may get this error even if your password is correct: 10 | ``` 11 | remote: Support for password authentication was removed on August 13, 2021. 12 | 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. 13 | fatal: Authentication failed for 'https://github.com/username/repository/' 14 | ``` 15 | - Github no longer allows using a password to access it 16 | - **Note:** if you're using Windows, running `git push ...` might open a popup asking you to log into Github. If so, click the button to sign in with browser, sign in to Github, and click Authorize 17 | - If the above does work or no popup appears, read the troubleshooting steps below 18 | 19 | 2. Instead of entering a password, we need to enter an access token 20 | 3. To create an access token, go to your Github account in your browser 21 | 4. Click your profile picture in the top-right, and click "Settings" 22 | 5. On the left, scroll down and click "Developer settings" 23 | 6. On the left, click "Personal access tokens", and click "Fine-grained tokens" 24 | 7. Click "Generate new token" 25 | 8. Set a Token name, Expiration = 30 days, Repository access = all repositories 26 | 9. Open "Repository permissions", scroll down to "Contents", and change the Access to "Read and write" 27 | 10. Scroll to the bottom and click "Generate token" 28 | 11. Github will give you an access token like this: 29 | ``` 30 | github_pat_11AY7DDYA0TJg09BH... (it's long) 31 | ``` 32 | 12. Copy this access token and put it in a safe place (don't share this since it can give anyone access to your Github) 33 | 13. Run `git push ...` again and when it asks for a password, paste the access token you created. (**Note:** if you're using the Terminal in VSCode, the password textbox will appear **at the top** of VSCode) 34 | 14. Press Enter, and `git push ...` should work. 35 | 36 | ### If using the access token did not work 37 | 1. Try running `git remote remove origin` 38 | 2. Run `git remote add origin https://@github.com//.git` (replace `` with your github username and `` with the name of your repository) 39 | 3. Git should ask for a password. Paste the access token you created earlier, press Enter 40 | --------------------------------------------------------------------------------