diff --git a/workbooks/github-foundations.md b/workbooks/github-foundations.md index 6753d80be..0b3d7d888 100644 --- a/workbooks/github-foundations.md +++ b/workbooks/github-foundations.md @@ -15,7 +15,7 @@ description: This student and teacher workbook will be your companion to the Git * [A short history of Git](http://git-scm.com/book/en/Getting-Started-A-Short-History-of-Git) * [The Git project homepage](http://git-scm.com) -#### Details +### Details __Git is an open source distributed__ version control system invented by Linus Torvalds in 2005. It is used to version the Linux kernel and is shown to be, by some research, the most popular modern version control system. Git is the open source, command line tool that forms a part of the workflows we'll cover in this course. It has been called the successor to CVS and Subversion by many users, and maintains some similarity in behavior to these historical open source version control tools. @@ -58,39 +58,52 @@ Sign up for a free GitHub account at https://github.com/join. Git can be installed as a unified GitHub GUI and command line or merely as a stand-alone command line interface. -## Ways of interacting with repositories +## Interacting with repositories ### Summary * [GitHub web flow](https://guides.github.com/overviews/flow/) * GitHub GUIs for Mac, Windows * Command line -## Getting to know GitHub +## Getting to know Git & GitHub ### Summary * Repository initialization -* Actionable steps (Create, Edit, Remove, Move) -* Commits (page) + * New project and new repository + * Repository based on existing content + * Through web interface + * Web interface and GUI client + +## Acquiring repos + +### Summary +* Clone from web (Clone in Desktop button) +* Clone via personal repo list in GitHub Desktop +* Complete "copy" explanation ## Version control basics ### Summary * Commits - * Line-level tracking - * Commit messages - * Grouping files (with desktop clients) -* Branching - * Branching concepts - * Branch selection menu - * Branch listing page - * Branch comparison view + * History marker for file(s), change(s) + * Record of author, time, and message +* Branches + * Container for grouped commits + * Simpler means to integrate change + * Cleaner code review possibilities +* GitHub, local repositories -## Acquiring repos +## GitHub repository interaction ### Summary -* Clone from web (Clone in Desktop button) -* Clone via personal repo list in GitHub Desktop -* Complete "copy" explanation +* Commits (GitHub.com) + * Actionable steps (Create, Edit, Remove, Move) + * Commit messages + * Listing page on GitHub +* Branches (GitHub.com) + * Selection menu + * Listing page + * Comparison view ## Local repository interaction @@ -102,6 +115,16 @@ Git can be installed as a unified GitHub GUI and command line or merely as a sta * History * Syncing (GHfD) +* Commits (GitHub for Desktop) + * Managing file on system, reviewing results + * Line-level tracking + * Grouping files + * Synchronizing local commits +* Branches (GitHub for Desktop) + * Create + * Change + * Publish + ## GitHub workflows ### Summary @@ -137,10 +160,60 @@ Git can be installed as a unified GitHub GUI and command line or merely as a sta * Network graph * Activity graph +## GitHub Wikis + +### Summary +* Fast documentation authoring for repositories +* Standalone repository +* Easy access from repository navigation + +## GitHub Pages + +### Summary +* Web page for your repository +* Web page for your account +* Author, edit, launch from GitHub + +## GitHub Features + +### Summary +* Notifications +* Watching repositories +* Starring repositories +* Gist +* GitHub Flavored Markdown + * Basics + * Emoji + * Checklists (Issues, Gists) + +## GitHub shortcuts + +### Summary + +* `/` command bar +* `?` help +* `t` fuzzy file search + ## Project management basics ### Summary * GitHub Issues * Milestones +* Network * Pulse * Tags, Releases +* Collaborators +* Organizations +* Teams + +## Special Repository Features of GitHub +* Contributing.md +* License.md + * During repository creation + * `+` a file with existing repository (special dropdown) +* .gitignore + * During repository creation + * `+` a file with existing repository (special dropdown) +* Readme.md + * In root + * In subfolders diff --git a/workbooks/github-intermediate.md b/workbooks/github-intermediate.md index eb4f491f2..c0ca10e05 100644 --- a/workbooks/github-intermediate.md +++ b/workbooks/github-intermediate.md @@ -249,6 +249,8 @@ $ git branch -a * Folding in branches * Resolving conflicting merges (manually edit) * Resolving file with shortcuts +* Updating topic branch from a base branch +* Integrating separate repo history #### Details ``` @@ -264,6 +266,10 @@ $ git checkout --theirs [file] $ git add [file] $ git commit + +$ git merge [base] + +$ git pull [repository] [branch] ``` ## Fetching changes @@ -271,11 +277,15 @@ $ git commit ### Summary * Comparing without merge * Merging selectively +* Retrieving from other repositories #### Details ``` $ git fetch [remote] $ git branch -a + +$ git fetch [repository] [branch] +$ git show FETCH_HEAD ``` ## Removing files @@ -302,7 +312,9 @@ $ git rm --cached -- ```shell $ mv $ git add -A . + # or + $ git mv $ git log --stat -M $ git log --follow @@ -364,7 +376,7 @@ $ git pop $ git stash --include-untracked ``` -## Recovering almost anything with the `reflog` +## Recovering almost anything with `reflog` ### Summary * Tracing Git action "history" @@ -376,13 +388,24 @@ $ git reflog $ git reflog --all $ git config --global alias.undo "reset HEAD@{1}" $ git checkout HEAD@{1} + +$ git reset --hard HEAD@{1} + +$ git branch [name] HEAD@{1} ``` ## Pull requests ### Summary -* Pushing branch to repo -* Creating GH pull request +* Pushing a branch to GitHub +* Using the GitHub interface +* Retrieving locally + +``` +$ git push -u [remote] [branch] + +$ git fetch [remote] refs/pull/[issue-number]/head +``` ## GitHub Issues @@ -399,6 +422,7 @@ $ git checkout HEAD@{1} #### Details ``` +$ git config --global alias.lol "log --graph --all --oneline --decorate" $ git config --global alias.l "log --oneline --stat" $ git config alias.s "status -s" $ git s