From 2ff2fa085a070718a631a38d141f3f30c2e6ecf4 Mon Sep 17 00:00:00 2001 From: Woose Date: Tue, 4 Mar 2025 18:01:01 +0300 Subject: [PATCH] update module1.ipynb --- module1.ipynb | 168 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 167 insertions(+), 1 deletion(-) diff --git a/module1.ipynb b/module1.ipynb index 67b2ef6..cd76e51 100644 --- a/module1.ipynb +++ b/module1.ipynb @@ -887,7 +887,173 @@ { "cell_type": "markdown", "metadata": {}, - "source": [] + "source": [ + "# The Basic Git Workflow\n", + "\n", + "This reading contains the code used in the instructional videos from [**The basic Git Workflow**Opens in a new tab](https://www.coursera.org/learn/introduction-git-github/lecture/p5zYm/the-basic-git-workflow)**.**\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", + "mkdir scripts\n", + "\n", + "cd scripts\n", + "\n", + "git init\n", + "```\n", + "\n", + "**Code output:**\n", + "\n", + "Initialized empty Git repository in /home/user/scripts/.git/\n", + "\n", + "```bash\n", + "git config \\-l\n", + "```\n", + "\n", + "**Code output:**\n", + "\n", + "user.email=me@example.com\n", + "\n", + "user.name=My name\n", + "\n", + "core.repositoryformatversion=0\n", + "\n", + "core.filemode=true\n", + "\n", + "core.bare=false\n", + "\n", + "core.logallrefupdates=true\n", + "\n", + "## File with code\n", + "\n", + "```bash\n", + "#!/usr/bin/env python3\n", + "\n", + "def main():\n", + "\n", + "    pass\n", + "\n", + "main()\n", + "```\n", + "\n", + "```bash\n", + "chmod +x all\\_checks.py\n", + "\n", + "git status\n", + "```\n", + "\n", + "**Code output:**\n", + "\n", + "On branch master\n", + "\n", + "No commits yet\n", + "\n", + "Untracked files:\n", + "\n", + "  (use \"git add ...\" to include in what will be committed)\n", + "\n", + "all\\_checks.py\n", + "\n", + "nothing added to commit but untracked files present (use \"git add\" to track)\n", + "\n", + "```bash\n", + "git add all\\_checks.py\n", + "\n", + "git commit\n", + "```\n", + "\n", + "## File with code\n", + "\n", + "```bash\n", + "Create an empty all\\_checks.\n", + "\n", + "# Please enter the commit message for your changes. Lines starting\n", + "\n", + "# with '#' will be ignored, and an empty message aborts the commit.\n", + "\n", + "#\n", + "\n", + "# On branch master\n", + "\n", + "#\n", + "\n", + "# Initial commit\n", + "\n", + "#\n", + "\n", + "# Changes to be committed:\n", + "\n", + "#       new file:   all\\_checks.py\n", + "\n", + "#\n", + "```\n", + "\n", + "## File with code\n", + "\n", + "```bash\n", + "#!/usr/bin/env python3\n", + "\n", + "import os\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 main():\n", + "\n", + "    pass\n", + "\n", + "main()\n", + "```\n", + "\n", + "```bash\n", + "git status\n", + "```\n", + "\n", + "On branch master\n", + "\n", + "Changes not staged for commit:\n", + "\n", + "  (use \"git add ...\" to update what will be committed)\n", + "\n", + "  (use \"git checkout -- ...\" to discard changes in working directory)\n", + "\n", + "modified:   all\\_checks.py\n", + "\n", + "no changes added to commit (use \"git add\" and/or \"git commit -a\")\n", + "\n", + "```bash\n", + "git add all\\_checks.py \n", + "\n", + "git status\n", + "```\n", + "\n", + "**Code output:**\n", + "\n", + "On branch master\n", + "\n", + "Changes to be committed:\n", + "\n", + "  (use \"git reset HEAD ...\" to unstage)\n", + "\n", + "modified:   all\\_checks.py\n", + "\n", + "```bash\n", + "git commit \\-m 'Add a check\\_reboot function'\n", + "```\n", + "\n", + "**Code output:**\n", + "\n", + "\\[master d8e139c\\] Add a check\\_reboot function\n", + "\n", + " 1 file changed, 6 insertions(+)" + ] }, { "cell_type": "markdown",