658 lines
26 KiB
Plaintext
658 lines
26 KiB
Plaintext
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Basic Interaction with GitHub\n",
|
||
"\n",
|
||
"This reading contains the code used in the instructional videos from [**Basic interaction with GitHub**<svg aria-labelledby=\"cds-react-aria3604314262-:r3dn:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3dn:\"><title id=\"cds-react-aria3604314262-:r3dn:-title\">Opens in a new tab</title></svg>](https://www.coursera.org/learn/introduction-git-github/lecture/4Fl6n/basic-interaction-with-github)**.** \n",
|
||
"\n",
|
||
"## Introduction\n",
|
||
"\n",
|
||
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written, allow you to practice running it, and can be used as a reference to refer back to. \n",
|
||
"\n",
|
||
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git clone https://github.com/redquinoa/health\\-checks.git\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"Cloning into 'health-checks'...\n",
|
||
"\n",
|
||
"Username for 'https://github.com': redquinoa\n",
|
||
"\n",
|
||
"Password for 'https://redquinoa@github.com': \n",
|
||
"\n",
|
||
"remote: Enumerating objects: 3, done.\n",
|
||
"\n",
|
||
"remote: Counting objects: 100% (3/3), done.\n",
|
||
"\n",
|
||
"remote: Compressing objects: 100% (2/2), done.\n",
|
||
"\n",
|
||
"remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0\n",
|
||
"\n",
|
||
"Unpacking objects: 100% (3/3), done.\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"cd health\\-checks/\n",
|
||
"\n",
|
||
"ls \\-l\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"total 4\n",
|
||
"\n",
|
||
"\\-rw-rw-r-- 1 user user 62 Jan 6 14:06 README.md\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"atom README.md\n",
|
||
"\n",
|
||
"# health-checks\n",
|
||
"\n",
|
||
"Scripts that check the health of my computers\n",
|
||
"\n",
|
||
"This repo will be populated with lots of fancy checks. \n",
|
||
"```\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git commit \\-a \\-m \"Add one more line to README.md\"\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:**\n",
|
||
"\n",
|
||
"\\[master 807cb50\\] Add one more line to README.md\n",
|
||
"\n",
|
||
" 1 file changed, 2 insertions(+)\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git push\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"Username for 'https://github.com': redquinoa\n",
|
||
"\n",
|
||
"Password for 'https://redquinoa@github.com': \n",
|
||
"\n",
|
||
"Enumerating objects: 5, done.\n",
|
||
"\n",
|
||
"Counting objects: 100% (5/5), done.\n",
|
||
"\n",
|
||
"Delta compression using up to 4 threads\n",
|
||
"\n",
|
||
"Compressing objects: 100% (2/2), done.\n",
|
||
"\n",
|
||
"Writing objects: 100% (3/3), 347 bytes | 347.00 KiB/s, done.\n",
|
||
"\n",
|
||
"Total 3 (delta 0), reused 0 (delta 0)\n",
|
||
"\n",
|
||
"To https://github.com/redquinoa/health-checks.git\n",
|
||
"\n",
|
||
" 3d9f86c..807cb50 master -> master\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git config \\--global credential.helper cache\n",
|
||
"```\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git pull\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"Username for 'https://github.com': redquinoa\n",
|
||
"\n",
|
||
"Password for 'https://redquinoa@github.com': \n",
|
||
"\n",
|
||
"Already up to date.\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git pull\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"Already up to date."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Study guide: Basic Interaction with GitHub\n",
|
||
"\n",
|
||
"---\n",
|
||
"title: \"Study guide: Basic Interaction with GitHub | Coursera\"\n",
|
||
"source: \"https://www.coursera.org/learn/introduction-git-github/supplement/cOouv/study-guide-basic-interaction-with-github\"\n",
|
||
"author:\n",
|
||
" - \"[[Coursera]]\"\n",
|
||
"published:\n",
|
||
"created: 2025-03-07\n",
|
||
"description: \"In this module, you’ll be introduced to GitHub and learn how it works with Git. You’ll create new repositories and clone those repositories onto your computer. Next, we’ll explain what a remote repository is, how we can work with them, and how we ...\"\n",
|
||
"tags:\n",
|
||
" - \"clippings\"\n",
|
||
"---\n",
|
||
"There are various remote repository hosting sites:\n",
|
||
"\n",
|
||
"- [GitHub<svg aria-labelledby=\"cds-react-aria3604314262-:r3lv:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3lv:\"><title id=\"cds-react-aria3604314262-:r3lv:-title\">Opens in a new tab</title></svg>](http://github.com/)\n",
|
||
"- [BitBucket<svg aria-labelledby=\"cds-react-aria3604314262-:r3m1:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3m1:\"><title id=\"cds-react-aria3604314262-:r3m1:-title\">Opens in a new tab</title></svg>](https://bitbucket.org/product)\n",
|
||
"- [Gitlab<svg aria-labelledby=\"cds-react-aria3604314262-:r3m3:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3m3:\"><title id=\"cds-react-aria3604314262-:r3m3:-title\">Opens in a new tab</title></svg>](https://gitlab.com/).\n",
|
||
"\n",
|
||
"Follow the workflow at [https://github.com/join<svg aria-labelledby=\"cds-react-aria3604314262-:r3m5:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3m5:\"><title id=\"cds-react-aria3604314262-:r3m5:-title\">Opens in a new tab</title></svg>](https://github.com/join) to set up a free account, username, and password. After that, [these steps<svg aria-labelledby=\"cds-react-aria3604314262-:r3m7:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3m7:\"><title id=\"cds-react-aria3604314262-:r3m7:-title\">Opens in a new tab</title></svg>](https://help.github.com/articles/create-a-repo/) will help you create a brand new repository on GitHub.\n",
|
||
"\n",
|
||
"Some useful commands for getting started:\n",
|
||
"\n",
|
||
"| Command | Explanation & Link |\n",
|
||
"| --- | --- |\n",
|
||
"| git clone URL | [Git clone is used to clone a remote repository into a local workspace<svg aria-labelledby=\"cds-react-aria3604314262-:r3m9:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3m9:\"><title id=\"cds-react-aria3604314262-:r3m9:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-clone) |\n",
|
||
"| git push | [Git push is used to push commits from your local repo to a remote repo<svg aria-labelledby=\"cds-react-aria3604314262-:r3mb:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3mb:\"><title id=\"cds-react-aria3604314262-:r3mb:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-push) |\n",
|
||
"| git pull | [Git pull is used to fetch the newest updates from a remote repository<svg aria-labelledby=\"cds-react-aria3604314262-:r3md:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3md:\"><title id=\"cds-react-aria3604314262-:r3md:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-pull) |\n",
|
||
"\n",
|
||
"This can be useful for keeping your local workspace up to date.\n",
|
||
"\n",
|
||
"- [https://help.github.com/en/articles/caching-your-github-password-in-git<svg aria-labelledby=\"cds-react-aria3604314262-:r3mf:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3mf:\"><title id=\"cds-react-aria3604314262-:r3mf:-title\">Opens in a new tab</title></svg>](https://help.github.com/en/articles/caching-your-github-password-in-git)\n",
|
||
"- [https://help.github.com/en/articles/generating-an-ssh-key<svg aria-labelledby=\"cds-react-aria3604314262-:r3mh:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r3mh:\"><title id=\"cds-react-aria3604314262-:r3mh:-title\">Opens in a new tab</title></svg>](https://help.github.com/en/articles/generating-an-ssh-key)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Working with Remotes\n",
|
||
"\n",
|
||
"This reading contains the code used in the instructional videos from [**Working with remotes**<svg aria-labelledby=\"cds-react-aria3604314262-:r454:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r454:\"><title id=\"cds-react-aria3604314262-:r454:-title\">Opens in a new tab</title></svg>](https://www.coursera.org/learn/introduction-git-github/lecture/udUgl/working-with-remotes)\n",
|
||
"\n",
|
||
"## Introduction\n",
|
||
"\n",
|
||
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written and can be used as a reference as you work through the course.\n",
|
||
"\n",
|
||
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"cd health\\-checks/\n",
|
||
"\n",
|
||
"git remote \\-v\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"origin https://github.com/redquinoa/health-checks.git (fetch)\n",
|
||
"\n",
|
||
"origin https://github.com/redquinoa/health-checks.git (push)\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git remote show origin\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"Username for 'https://github.com': redquinoa\n",
|
||
"\n",
|
||
"Password for 'https://redquinoa@github.com': \n",
|
||
"\n",
|
||
"\\* remote origin\n",
|
||
"\n",
|
||
" Fetch URL: https://github.com/redquinoa/health-checks.git\n",
|
||
"\n",
|
||
" Push URL: https://github.com/redquinoa/health-checks.git\n",
|
||
"\n",
|
||
" HEAD branch: master\n",
|
||
"\n",
|
||
" Remote branch:\n",
|
||
"\n",
|
||
" master tracked\n",
|
||
"\n",
|
||
" Local branch configured for 'git pull':\n",
|
||
"\n",
|
||
" master merges with remote master\n",
|
||
"\n",
|
||
" Local ref configured for 'git push':\n",
|
||
"\n",
|
||
" master pushes to master (up to date)\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git branch \\-r\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:**\n",
|
||
"\n",
|
||
" origin/HEAD -> origin/master\n",
|
||
"\n",
|
||
" origin/master\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git status\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"On branch master\n",
|
||
"\n",
|
||
"Your branch is up to date with 'origin/master'.\n",
|
||
"\n",
|
||
"nothing to commit, working tree clean"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Fetching New Changes\n",
|
||
"\n",
|
||
"This reading contains the code used in the instructional videos from [**Fetching New Changes**<svg aria-labelledby=\"cds-react-aria3604314262-:r4dc:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r4dc:\"><title id=\"cds-react-aria3604314262-:r4dc:-title\">Opens in a new tab</title></svg>](https://www.coursera.org/learn/introduction-git-github/lecture/vbWpa/fetching-new-changes)\n",
|
||
"\n",
|
||
"## Introduction\n",
|
||
"\n",
|
||
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written and can be used as a reference as you work through the course.\n",
|
||
"\n",
|
||
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"cd health\\-checks/\n",
|
||
"\n",
|
||
"git remote show origin\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"\\* remote origin\n",
|
||
"\n",
|
||
" Fetch URL: https://github.com/redquinoa/health-checks.git\n",
|
||
"\n",
|
||
" Push URL: https://github.com/redquinoa/health-checks.git\n",
|
||
"\n",
|
||
" HEAD branch: master\n",
|
||
"\n",
|
||
" Remote branch:\n",
|
||
"\n",
|
||
" master tracked\n",
|
||
"\n",
|
||
" Local branch configured for 'git pull':\n",
|
||
"\n",
|
||
" master merges with remote master\n",
|
||
"\n",
|
||
" Local ref configured for 'git push':\n",
|
||
"\n",
|
||
" master pushes to master (local out of date)\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git fetch\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:**\n",
|
||
"\n",
|
||
"remote: Enumerating objects: 5, done.\n",
|
||
"\n",
|
||
"remote: Counting objects: 100% (5/5), done.\n",
|
||
"\n",
|
||
"remote: Compressing objects: 100% (4/4), done.\n",
|
||
"\n",
|
||
"remote: Total 4 (delta 0), reused 4 (delta 0), pack-reused 0\n",
|
||
"\n",
|
||
"Unpacking objects: 100% (4/4), done.\n",
|
||
"\n",
|
||
"From https://github.com/redquinoa/health-checks\n",
|
||
"\n",
|
||
" 807cb50..b62dc2e master -> origin/master\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git log origin/master\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:**\n",
|
||
"\n",
|
||
"commit b62dc2eacfa820cd9a762adab9213305d1c8d344 (origin/master, origin/HEAD)\n",
|
||
"\n",
|
||
"Author: Blue Kale <bluekale@example.com>\n",
|
||
"\n",
|
||
"Date: Mon Jan 6 14:32:45 2020 -0800\n",
|
||
"\n",
|
||
" Add initial files for the checks\n",
|
||
"\n",
|
||
"commit 807cb5037ccac5512ba583e782c35f4e114f8599 (HEAD -> master)\n",
|
||
"\n",
|
||
"Author: My name <me@example.com>\n",
|
||
"\n",
|
||
"Date: Mon Jan 6 14:09:41 2020 -800\n",
|
||
"\n",
|
||
" Add one more line to README.md\n",
|
||
"\n",
|
||
"commit 3d9f86c50b8651d41adabdaebd04530f4694efb5\n",
|
||
"\n",
|
||
"Author: Red Quinoa <55592533+redquinoa@users.noreply.github.com>\n",
|
||
"\n",
|
||
"Date: Sat Sep 21 14:04:15 2019 -0700\n",
|
||
"\n",
|
||
" Initial commit\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git status\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"On branch master\n",
|
||
"\n",
|
||
"Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.\n",
|
||
"\n",
|
||
" (use \"git pull\" to update your local branch)\n",
|
||
"\n",
|
||
"nothing to commit, working tree clean\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git merge origin/master\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"Updating 807cb50..b62dc2e\n",
|
||
"\n",
|
||
"Fast-forward\n",
|
||
"\n",
|
||
" all\\_checks.py | 18 ++++++++++++++++++\n",
|
||
"\n",
|
||
" disk\\_usage.py | 24 ++++++++++++++++++++++++\n",
|
||
"\n",
|
||
" 2 files changed, 42 insertions(+)\n",
|
||
"\n",
|
||
" create mode 100755 all\\_checks.py\n",
|
||
"\n",
|
||
" create mode 100644 disk\\_usage.py\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git log\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:**\n",
|
||
"\n",
|
||
"commit 1e0a1dfccf01183bfca7e30fb25f115889f95022 (HEAD -> master, origin/master, origin/HEAD)\n",
|
||
"\n",
|
||
"commit b62dc2eacfa820cd9a762adab9213305d1c8d344 (HEAD -> master, origin/master, origin/HEAD)\n",
|
||
"\n",
|
||
"Author: Blue Kale <bluekale@example.com>\n",
|
||
"\n",
|
||
"Date: Mon Jan 6 14:32:45 2020 -0800\n",
|
||
"\n",
|
||
" Add initial files for the checks\n",
|
||
"\n",
|
||
"commit 807cb5037ccac5512ba583e782c35f4e114f8599 (HEAD -> master)\n",
|
||
"\n",
|
||
"Author: My name <me@example.com>\n",
|
||
"\n",
|
||
"Date: Mon Jan 6 14:09:41 2020 -800\n",
|
||
"\n",
|
||
" Add one more line to README.md\n",
|
||
"\n",
|
||
"commit 3d9f86c50b8651d41adabdaebd04530f4694efb5\n",
|
||
"\n",
|
||
"Author: Red Quinoa <55592533+redquinoa@users.noreply.github.com>\n",
|
||
"\n",
|
||
"Date: Sat Sep 21 14:04:15 2019 -0700"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Updating the Local Repository\n",
|
||
"\n",
|
||
"This reading contains the code used in the instructional videos from [**Updating the Local Repository**<svg aria-labelledby=\"cds-react-aria3604314262-:r4m2:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r4m2:\"><title id=\"cds-react-aria3604314262-:r4m2:-title\">Opens in a new tab</title></svg>](https://www.coursera.org/learn/introduction-git-github/lecture/UjnyI/updating-the-local-repository)\n",
|
||
"\n",
|
||
"## Introduction\n",
|
||
"\n",
|
||
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written and can be used as a reference as you work through the course.\n",
|
||
"\n",
|
||
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git pull\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"remote: Enumerating objects: 8, done.\n",
|
||
"\n",
|
||
"remote: Counting objects: 100% (8/8), done.\n",
|
||
"\n",
|
||
"remote: Compressing objects: 100% (5/5), done.\n",
|
||
"\n",
|
||
"Unpacking objects: 100% (6/6), done.\n",
|
||
"\n",
|
||
"remote: Total 6 (delta 1), reused 6 (delta 1), pack-reused 0\n",
|
||
"\n",
|
||
"From https://github.com/redquinoa/health-checks\n",
|
||
"\n",
|
||
" 807cb50..b62dc2e master -> origin/master\n",
|
||
"\n",
|
||
" \\* \\[new branch\\] experimental -> origin/experimental\n",
|
||
"\n",
|
||
"Updating 807cb50..b62dc2e\n",
|
||
"\n",
|
||
"Fast-forward\n",
|
||
"\n",
|
||
" all\\_checks.py | 15 +++++++++++++++\n",
|
||
"\n",
|
||
" 1 file changed, 15 insertions(+)\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git \\-log \\-p \\-1\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"commit 922d65950b5325109525a24b71d8df8a46412d04 (HEAD -> master, origin/master, origin/HEAD)\n",
|
||
"\n",
|
||
"Author: Blue Kale <bluekale@example.com>\n",
|
||
"\n",
|
||
"Date: Mon Jan 6 14:42:44 2020 -0800\n",
|
||
"\n",
|
||
" Add disk full check to all\\_checks.py\n",
|
||
"\n",
|
||
"diff --git a/all\\_checks.py b/all\\_checks.py\n",
|
||
"\n",
|
||
"index fdc4476..e46cdae 100755\n",
|
||
"\n",
|
||
"\\--- a/all\\_checks.py\n",
|
||
"\n",
|
||
"+++ b/all\\_checks.py\n",
|
||
"\n",
|
||
"@@ -1,16 +1,31 @@\n",
|
||
"\n",
|
||
" #!/usr/bin/env python3\n",
|
||
"\n",
|
||
" import os\n",
|
||
"\n",
|
||
"+import shutil\n",
|
||
"\n",
|
||
" import sys\n",
|
||
"\n",
|
||
"(...)\n",
|
||
"\n",
|
||
"def(check\\_reboot): \n",
|
||
"\n",
|
||
"\"\"\" Returns True if the computer has a pending reboot.\"\"\"\n",
|
||
"\n",
|
||
"Return os.path.exists(“/run/reboot-required”)\n",
|
||
"\n",
|
||
"+def check\\_disk\\_full(disk, mmin\\_absolute, min\\_percent):\n",
|
||
"\n",
|
||
"\\+ \"\"\"Returns True if there isn’t enough disk space, False otherwise.\"\"\"\n",
|
||
"\n",
|
||
"\\+ du = shutil.disk\\_usage(disk)\n",
|
||
"\n",
|
||
"\\+ # Calculate the percentage of free space\n",
|
||
"\n",
|
||
"\\+ percent\\_free = 100 \\* du.free / du.total\n",
|
||
"\n",
|
||
"\\+ # Calculate how many free gigabytes\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git remote show origin\n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"\\* remote origin\n",
|
||
"\n",
|
||
" Fetch URL: https://github.com/redquinoa/health-checks.git\n",
|
||
"\n",
|
||
" Push URL: https://github.com/redquinoa/health-checks.git\n",
|
||
"\n",
|
||
" HEAD branch: master\n",
|
||
"\n",
|
||
" Remote branches:\n",
|
||
"\n",
|
||
" experimental tracked\n",
|
||
"\n",
|
||
" master tracked\n",
|
||
"\n",
|
||
" Local branch configured for 'git pull':\n",
|
||
"\n",
|
||
" master merges with remote master\n",
|
||
"\n",
|
||
" Local ref configured for 'git push':\n",
|
||
"\n",
|
||
" master pushes to master (up to date)\n",
|
||
"\n",
|
||
"```bash\n",
|
||
"git checkout experimental \n",
|
||
"```\n",
|
||
"\n",
|
||
"**Code output:** \n",
|
||
"\n",
|
||
"Branch 'experimental' set up to track remote branch 'experimental' from 'origin'.\n",
|
||
"\n",
|
||
"Switched to a new branch 'experimental'"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Study guide: Git Remotes\n",
|
||
"\n",
|
||
"You’ve learned about what a remote is, working with remotes, fetching new changes, and updating the local repository. Use this study guide as an easy reference of Git commands for working with remotes. This study guide gives a brief explanation of these useful commands along with a link to the Git documentation for each command. Keeping study guides like this one easily accessible can help you code more efficiently.\n",
|
||
"\n",
|
||
"| Command | Explanation & Links |\n",
|
||
"| --- | --- |\n",
|
||
"| git remote | [$ git remote<svg aria-labelledby=\"cds-react-aria3604314262-:r54k:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r54k:\"><title id=\"cds-react-aria3604314262-:r54k:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-remote) allows you to manage the set of repositories or “remotes” whose branches you track. |\n",
|
||
"| git remote -v | [$ git remote -v<svg aria-labelledby=\"cds-react-aria3604314262-:r54m:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r54m:\"><title id=\"cds-react-aria3604314262-:r54m:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt--v) is similar to $ git remote, but adding the -v shows more information such as the remote URL. |\n",
|
||
"| git remote show <name> | [$ git remote show <name><svg aria-labelledby=\"cds-react-aria3604314262-:r54o:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r54o:\"><title id=\"cds-react-aria3604314262-:r54o:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emshowem) shows some information about a single remote repo. |\n",
|
||
"| git remote update | [$ git remote update<svg aria-labelledby=\"cds-react-aria3604314262-:r54q:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r54q:\"><title id=\"cds-react-aria3604314262-:r54q:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emupdateem) fetches updates for remotes or remote groups. |\n",
|
||
"| git fetch | [$ git fetch<svg aria-labelledby=\"cds-react-aria3604314262-:r54s:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r54s:\"><title id=\"cds-react-aria3604314262-:r54s:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-fetch) can download objects and refs from a single repo, a single URL, or from several repositories at once. |\n",
|
||
"| git branch -r | [$ git branch -r<svg aria-labelledby=\"cds-react-aria3604314262-:r54u:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r54u:\"><title id=\"cds-react-aria3604314262-:r54u:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--r) lists remote branches and can be combined with other branch arguments to manage remote branches. |\n",
|
||
"\n",
|
||
"Keep this table handy while you are getting comfortable using Git remotes. Now, it’s time to put your newfound knowledge of Git remotes to use!"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# What is secure shell?"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# The SSH protocol"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Configuring SSH"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# API Keys"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# When to use API Keys"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Public vs. private keys"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# The Pull-Merge-Push Workflow"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Pushing Remote Branches"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Rebasing Your Changes"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Another Rebasing Example"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Study guide: Conflict resolution"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Glossary terms from module 3"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Exemplar: Introduction to GitHub"
|
||
]
|
||
}
|
||
],
|
||
"metadata": {
|
||
"kernelspec": {
|
||
"display_name": "Python 3",
|
||
"language": "python",
|
||
"name": "python3"
|
||
},
|
||
"language_info": {
|
||
"name": "python",
|
||
"version": "3.12.3"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 2
|
||
}
|