update module1.ipynb

This commit is contained in:
Yavuz Sava 2025-03-04 18:01:01 +03:00
parent 553c9752b3
commit 2ff2fa085a

View File

@ -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**<svg aria-labelledby=\"cds-react-aria1810281246-:r2r:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria1810281246-:r2r:\"><title id=\"cds-react-aria1810281246-:r2r:-title\">Opens in a new tab</title></svg>](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 <file>...\" 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 <file>...\" to update what will be committed)\n",
"\n",
"  (use \"git checkout -- <file>...\" 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 <file>...\" 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",