update module2.ipynb
This commit is contained in:
parent
119672fae3
commit
3c9b7e493b
@ -494,7 +494,27 @@
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Study Guide: Advanced Git\n",
|
||||
"\n"
|
||||
"\n",
|
||||
"| Command | Explanation & Link |\n",
|
||||
"| --- | --- |\n",
|
||||
"| git commit -a | [$ git commit -a<svg aria-labelledby=\"cds-react-aria6078214324-:r2lc:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2lc:\"><title id=\"cds-react-aria6078214324-:r2lc:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---all) automatically stages the files that have been locally modified. New files which have not been published yet are not affected. |\n",
|
||||
"| git log -p | [$ git log -p<svg aria-labelledby=\"cds-react-aria6078214324-:r2le:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2le:\"><title id=\"cds-react-aria6078214324-:r2le:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-log#generate_patch_text_with_p) produces patch text that displays the lines of code that were changed in each commit in the current repo. |\n",
|
||||
"| git show | [$ git show<svg aria-labelledby=\"cds-react-aria6078214324-:r2lg:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2lg:\"><title id=\"cds-react-aria6078214324-:r2lg:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-show) shows you one or more object(s) such as blobs, trees, tags, and commits. |\n",
|
||||
"| git diff | [$ git diff<svg aria-labelledby=\"cds-react-aria6078214324-:r2li:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2li:\"><title id=\"cds-react-aria6078214324-:r2li:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-diff) is similar to the Linux \\`diff\\` command, and can show the changes between commits, changes between the working tree and index, changes between two trees, changes from a merge, and so on. |\n",
|
||||
"| git diff --staged | [$ git diff --staged<svg aria-labelledby=\"cds-react-aria6078214324-:r2lk:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2lk:\"><title id=\"cds-react-aria6078214324-:r2lk:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-diff) is an alias of $ git diff --cached, which shows all staged files compared to the named commit. |\n",
|
||||
"| git add -p | [$ git add -p<svg aria-labelledby=\"cds-react-aria6078214324-:r2lm:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2lm:\"><title id=\"cds-react-aria6078214324-:r2lm:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-add) allows a user to interactively review patches before adding to the current commit. |\n",
|
||||
"| git mv | [$ git mv<svg aria-labelledby=\"cds-react-aria6078214324-:r2lo:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2lo:\"><title id=\"cds-react-aria6078214324-:r2lo:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-mv) is similar to the Linux \\`mv\\` command. This command can move or rename a file, directory, or symlink. |\n",
|
||||
"| git rm | [$ git rm <svg aria-labelledby=\"cds-react-aria6078214324-:r2lq:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2lq:\"><title id=\"cds-react-aria6078214324-:r2lq:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/git-rm)is similar to the Linux \\`rm\\` command. This command deletes or removes a file from the working tree. |\n",
|
||||
"\n",
|
||||
"There are many useful git command summaries online as well. Please take some time to research and study a few, such as [this one<svg aria-labelledby=\"cds-react-aria6078214324-:r2ls:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2ls:\"><title id=\"cds-react-aria6078214324-:r2ls:-title\">Opens in a new tab</title></svg>](https://education.github.com/git-cheat-sheet-education.pdf).\n",
|
||||
"\n",
|
||||
"## .gitignore files\n",
|
||||
"\n",
|
||||
".gitignore files are used to tell the git tool to intentionally ignore some files in a given Git repository. For example, this can be useful for configuration files or metadata files that a user may not want to check into the master branch. \n",
|
||||
"\n",
|
||||
"When writing a .gitignore file, there are some specific formats which help tell Git how to read the text in the file. For example, a line starting with # is a comment; a slash / is a directory separator. Visit [https://git-scm.com/docs/gitignore<svg aria-labelledby=\"cds-react-aria6078214324-:r2lu:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2lu:\"><title id=\"cds-react-aria6078214324-:r2lu:-title\">Opens in a new tab</title></svg>](https://git-scm.com/docs/gitignore) to see more examples.\n",
|
||||
"\n",
|
||||
"[This GitHub repository<svg aria-labelledby=\"cds-react-aria6078214324-:r2m0:-title\" fill=\"none\" focusable=\"false\" height=\"16\" role=\"img\" viewBox=\"0 0 20 20\" width=\"16\" class=\"css-8blerm\" id=\"cds-react-aria6078214324-:r2m0:\"><title id=\"cds-react-aria6078214324-:r2m0:-title\">Opens in a new tab</title></svg>](https://gist.github.com/octocat/9257657) offers some examples of configurations which are often included in a .gitignore file. These examples include: compiled sources, packages, logs, databases, and OS generated files."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user