update module2.ipynb
This commit is contained in:
parent
9b47ce8ccc
commit
1678dec6ad
225
module2.ipynb
225
module2.ipynb
@ -1423,7 +1423,230 @@
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Merge conflicts\n",
|
||||
"\n"
|
||||
"\n",
|
||||
"This reading contains the code used in the instructional videos from [**Merge Conflicts**<svg aria-labelledby=\"cds-react-aria3604314262-:r1af:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria3604314262-:r1af:\"><title id=\"cds-react-aria3604314262-:r1af:-title\">Opens in a new tab</title></svg>](https://www.coursera.org/learn/introduction-git-github/lecture/96VdS/merge-conflicts)\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",
|
||||
"atom free\\_memory.py\n",
|
||||
"\n",
|
||||
"#!/usr/bin/env python3\n",
|
||||
"\n",
|
||||
"def main():\n",
|
||||
"\n",
|
||||
" \"\"\"Checks if there's enough free memory in the computer.\"\"\"\n",
|
||||
"\n",
|
||||
"main()\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git commit \\-a \\-m 'Add comment to main()'\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:** \n",
|
||||
"\n",
|
||||
"\\[master fe2fc5b\\] Add comment to main()\n",
|
||||
"\n",
|
||||
" 1 file changed, 2 insertions(+), 2 deletions(-)\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git checkout even\\-better-feature \n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:**\n",
|
||||
"\n",
|
||||
"Switched to branch 'even-better-feature'\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"atom free\\_memory.py \n",
|
||||
"\n",
|
||||
"#!/usr/bin/env python3\n",
|
||||
"\n",
|
||||
"def main():\n",
|
||||
"\n",
|
||||
" print(\"Everything ok.\")\n",
|
||||
"\n",
|
||||
"main()\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git commit \\-a \\-m 'Print everything ok'\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:** \n",
|
||||
"\n",
|
||||
"\\[even-better-feature 6a6de99\\] Print everything ok\n",
|
||||
"\n",
|
||||
"1 file changed, 2 insertions(+), 2 deletions(-)\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git checkout master\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:** \n",
|
||||
"\n",
|
||||
"Switched to branch 'master'\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git merge even\\-better-feature \n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:** \n",
|
||||
"\n",
|
||||
"Auto-merging free\\_memory.py\n",
|
||||
"\n",
|
||||
"CONFLICT (content): Merge conflict in free\\_memory.py\n",
|
||||
"\n",
|
||||
"Automatic merge failed; fix conflicts and then commit the result.\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git status\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:** \n",
|
||||
"\n",
|
||||
"On branch master\n",
|
||||
"\n",
|
||||
"You have unmerged paths.\n",
|
||||
"\n",
|
||||
" (fix conflicts and run \"git commit\")\n",
|
||||
"\n",
|
||||
" (use \"git merge --abort\" to abort the merge)\n",
|
||||
"\n",
|
||||
"Unmerged paths:\n",
|
||||
"\n",
|
||||
" (use \"git add <file>...\" to mark resolution)\n",
|
||||
"\n",
|
||||
" both modified: free\\_memory.py\n",
|
||||
"\n",
|
||||
"no changes added to commit (use \"git add\" and/or \"git commit -a\")\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"atom free\\_memory.py \n",
|
||||
"\n",
|
||||
"#!/usr/bin/env python3\n",
|
||||
"\n",
|
||||
"def main():\n",
|
||||
"\n",
|
||||
"<<<<<<< HEAD\n",
|
||||
"\n",
|
||||
" \"\"\"Checks if there's enough free memory in the computer.\"\"\"\n",
|
||||
"\n",
|
||||
"\\=======\n",
|
||||
"\n",
|
||||
" print(\"Everything ok.\")\n",
|
||||
"\n",
|
||||
"\\>>>>>>> even\\-better-feature\n",
|
||||
"\n",
|
||||
"main()\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"#!/usr/bin/env python3\n",
|
||||
"\n",
|
||||
"def main():\n",
|
||||
"\n",
|
||||
" \"\"\"Checks if there's enough free memory in the computer.\"\"\"\n",
|
||||
"\n",
|
||||
" print(\"Everything ok.\")\n",
|
||||
"\n",
|
||||
"main()\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git add free\\_memory.py\n",
|
||||
"\n",
|
||||
"git status\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:** \n",
|
||||
"\n",
|
||||
"On branch master\n",
|
||||
"\n",
|
||||
"All conflicts fixed but you are still merging.\n",
|
||||
"\n",
|
||||
" (use \"git commit\" to conclude merge)\n",
|
||||
"\n",
|
||||
"Changes to be committed:\n",
|
||||
"\n",
|
||||
" modified: free\\_memory.py\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git commit\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:** \n",
|
||||
"\n",
|
||||
"Merge branch 'even-better-feature'\n",
|
||||
"\n",
|
||||
"Kept lines from both branches\n",
|
||||
"\n",
|
||||
"\\# Conflicts:\n",
|
||||
"\n",
|
||||
"\\# free\\_memory.py\n",
|
||||
"\n",
|
||||
"\\#\n",
|
||||
"\n",
|
||||
"\\# It looks like you may be committing a merge.\n",
|
||||
"\n",
|
||||
"\\# If this is not correct, please remove the file\n",
|
||||
"\n",
|
||||
"\\# .git/MERGE\\_HEAD\n",
|
||||
"\n",
|
||||
"\\# and try again.\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",
|
||||
"\\# All conflicts fixed but you are still merging.\n",
|
||||
"\n",
|
||||
"\\#\n",
|
||||
"\n",
|
||||
"\\# Changes to be committed:\n",
|
||||
"\n",
|
||||
"\\# modified: free\\_memory.py\n",
|
||||
"\n",
|
||||
"```bash\n",
|
||||
"git log \\--graph \\--oneline\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"**Code output:** \n",
|
||||
"\n",
|
||||
"\\* 8cb5e62 (HEAD -> master) Merge branch 'even-better-feature'\n",
|
||||
"\n",
|
||||
"|\\\\ \n",
|
||||
"\n",
|
||||
"| \\* ca6de99 (even-better-feature) Print everything ok\n",
|
||||
"\n",
|
||||
"\\* | fe2fc5b Add comment to main()\n",
|
||||
"\n",
|
||||
"|/ \n",
|
||||
"\n",
|
||||
"\\* 4361880 Add an empty free\\_memory.py\n",
|
||||
"\n",
|
||||
"\\* 7d1de19 Revert \"New name for disk\\_usage.py\"\n",
|
||||
"\n",
|
||||
"\\* bb9bd78 Add a gitignore file, ignoring .DS\\_STORE files\n",
|
||||
"\n",
|
||||
"\\* 30e7071 New name for disk\\_usage.py\n",
|
||||
"\n",
|
||||
"\\* 0d5a271 Delete unneeded processes file\n",
|
||||
"\n",
|
||||
"\\* 5aada26 Adding file to delete it later\n",
|
||||
"\n",
|
||||
"\\* cfb2b8e Add periods to the end of sentences.\n",
|
||||
"\n",
|
||||
"\\* 21e6a1a Add new disk\\_usage check."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user