|
| 1 | +--- |
| 2 | +layout: bare |
| 3 | +title: Rich Web Experience 2013 Git Workshop |
| 4 | +description: Rich Web Experience 2013 Git Workshop Class Notes |
| 5 | +tags: [notes] |
| 6 | +path: classnotes/2013-12-03-rich-web-experience-2013-git-workshop.md |
| 7 | +eventdate: 2013-12-03 |
| 8 | +--- |
| 9 | + |
| 10 | +## Teachers |
| 11 | +* Tim Berglund ([Twitter](http://twitter.com/tlberglund), [GitHub](https://github.com/tlberglund)) |
| 12 | + |
| 13 | +## Resources |
| 14 | + |
| 15 | +* [Adding SSL Certificates for GitHub.com (Common for Windows XP)](http://stackoverflow.com/questions/3777075/https-github-access/4454754#4454754) |
| 16 | +* Disabling SSL Certificate Checks for Git: |
| 17 | + |
| 18 | + git config --global http.sslVerify false |
| 19 | +* [Open Source Git Ignore Templates](https://github.com/github/gitignore) |
| 20 | +* [Book Authoring on Git and GitHub](http://teach.github.com/articles/book-authoring-using-git-and-github/) |
| 21 | +* [Post Receive Hooks](https://help.github.com/articles/post-receive-hooks) |
| 22 | +* [GitHub Training Videos](http://training.github.com/resources/videos/) |
| 23 | +* [Using Git with Media Temple](http://carl-topham.com/theblog/post/using-git-media-temple/) |
| 24 | +* [GitHub Training Feedback and Follow-up Questions](https://github.com/githubtraining/feedback/issues?state=open) |
| 25 | +* [GitHub Commit Status API for Continuous Integration](https://github.com/blog/1227-commit-status-api) |
| 26 | +* [Git Credential Cache for HTTP](http://teach.github.com/articles/lesson-git-credential-cache/) |
| 27 | +* [GitHub Issues Cheatsheet](http://teach.github.com/articles/github-issues-cheatsheet/) |
| 28 | +* [Jenkins Git Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin) |
| 29 | +* [Open Source Git Ignores](https://github.com/github/gitignore) |
| 30 | +* [Ship of Theseus - Related to Similarity Index](http://en.wikipedia.org/wiki/Ship_of_Theseus) |
| 31 | +* [git-p4 Perforce Script](http://answers.perforce.com/articles/KB_Article/Git-P4) |
| 32 | +* [Unix watch command](http://en.wikipedia.org/wiki/Watch_(Unix\)) |
| 33 | +* [SHA-1 Hash Collisions](http://git-scm.com/book/ch6-1.html#A-SHORT-NOTE-ABOUT-SHA-1) |
| 34 | +* [NPD Git Cheatsheet](http://ndpsoftware.com/git-cheatsheet.html) |
| 35 | +* [More Git Cheatsheets](http://teach.github.com/articles/git-cheatsheets/) |
| 36 | + |
| 37 | +## Installation |
| 38 | +* Git Installation |
| 39 | + * [The Git-SCM Web Site (All Platforms)](http://git-scm.com) |
| 40 | + * [The GitHub for Windows Client and Command Line](http://windows.github.com) |
| 41 | +* Minimum is 1.7.ANYTHING, but can have issues with HTTPS credential prompting. |
| 42 | +* Best is 1.8.0 or higher |
| 43 | + |
| 44 | +## Suggested Books, Articles |
| 45 | +* [Free ProGit Book](http://git-scm.com/book) |
| 46 | +* [Getting started with Version Control](http://teach.github.com/articles/lesson-new-to-version-control/) |
| 47 | +* [The GitHub Flow](http://scottchacon.com/2011/08/31/github-flow.html) |
| 48 | +* [DVCS Workflows Book](https://github.com/zkessin/dvcs-workflows) |
| 49 | +* [Git Cheat Sheets](http://teach.github.com/articles/git-cheatsheets/) |
| 50 | +* [Git Workflow Links](https://pinboard.in/u:matthew.mccullough/t:git+workflow) |
| 51 | + |
| 52 | +## Course Materials, Links |
| 53 | +* [Git Teaching Materials](http://teach.github.com) |
| 54 | +* [Course Slides](http://teach.github.com/presentations/) |
| 55 | +* [Course Slides Source](https://github.com/github/teach.github.com/tree/gh-pages/presentations) |
| 56 | +* [Post-event Git and GitHub questions](https://github.com/githubtraining/feedback/) |
| 57 | +* [Free Office Hours Sessions](http://training.github.com/web/free-classes/) |
| 58 | + |
| 59 | +## Outline |
| 60 | + |
| 61 | +* Install and setup |
| 62 | +* Committing |
| 63 | +* Staging area |
| 64 | +* Comparing things (`diff`) |
| 65 | +* Looking at history (`log`) |
| 66 | +* Deleting and moving |
| 67 | + * Internals |
| 68 | +* Branching and merging |
| 69 | +* Rebasing |
| 70 | +* `reset` and `reflog` |
| 71 | +* Remote repos |
| 72 | + * `push`, `pull`, `fetch` |
| 73 | +* Pull requests |
| 74 | +* Collaboration on GitHub in general |
| 75 | +* "Briefly" touch on submodules |
| 76 | +* SVN migration |
| 77 | + * Mechanics |
| 78 | + * Social and political |
| 79 | +* Gist |
| 80 | +* Hooks |
| 81 | + |
| 82 | + |
| 83 | +## Command History |
| 84 | + |
| 85 | + git init newproject |
| 86 | + cd newproject |
| 87 | + ls -la |
| 88 | + tree .git |
| 89 | + git config user.name |
| 90 | + git config user.email |
| 91 | + git config --global user.name "Tim Berglund" |
| 92 | + git config --global user.email "tlberglund@github.com" |
| 93 | + git config --global color.ui auto |
| 94 | + vi caesar.txt |
| 95 | + git commit -m "Initial commit" |
| 96 | + git commit -m "Noblest man" |
| 97 | + git diff HEAD |
| 98 | + git diff HEAD --color-words |
| 99 | + git diff HEAD --word-diff |
| 100 | + git diff --staged |
| 101 | + git commit -m "Costly blood" |
| 102 | + git commit -m "Iambic" |
| 103 | + git help log |
| 104 | + git log --author=Tim |
| 105 | + git log --author="Fird' |
| 106 | + git log --author="Fird" |
| 107 | + git log |
| 108 | + git log --format=raw |
| 109 | + git log --graph |
| 110 | + git log --graph --oneline |
| 111 | + git log --graph --oneline --decorate |
| 112 | + git log --graph --oneline --decorate --all |
| 113 | + git config --global alias.lol "log --graph --oneline --decorate --all" |
| 114 | + cd scratch/newproject |
| 115 | + git loglive |
| 116 | + generaterandomfiles 6 junk txt |
| 117 | + git commit -m "Cruft" |
| 118 | + git rm junk1.txt |
| 119 | + rm junk2.txt |
| 120 | + git rm junk2.txt |
| 121 | + open . |
| 122 | + git add -u . |
| 123 | + git help add |
| 124 | + git rm --cached junk6.txt |
| 125 | + git commit -m "Cleanup cruft" |
| 126 | + git add .gitignore |
| 127 | + run-help git |
| 128 | + git commit -m "Added .gitignore" |
| 129 | + mkdir -p src/main/resources |
| 130 | + ll /etc > src/main/resources/real-file.log |
| 131 | + vi src/main/resources/.gitignore |
| 132 | + vi .gitignore |
| 133 | + git diff |
| 134 | + git checkout HEAD -- .gitignore |
| 135 | + git status -u |
| 136 | + rm -rf src |
| 137 | + rm junk6.txt |
| 138 | + generaterandomfiles 5 file txt |
| 139 | + ls -l ~ > listing.txt |
| 140 | + cat file1.txt |
| 141 | + cat file2.txt |
| 142 | + cat file4.txt |
| 143 | + cat listing.txt |
| 144 | + git commit -m "Ready to move" |
| 145 | + mkdir files |
| 146 | + mkdir files/monkey |
| 147 | + rm -rf files/monkey |
| 148 | + git mv file1.txt files/ |
| 149 | + mv file2.txt files/ |
| 150 | + git rm file2.txt |
| 151 | + git add files/file2.txt |
| 152 | + git commit -m "Moved small things" |
| 153 | + vi listing.txt |
| 154 | + git add -A . |
| 155 | + git commit -m "Moved AND changed" |
| 156 | + vi files/listing.txt |
| 157 | + git commit -m "Change after move" |
| 158 | + git log --stat |
| 159 | + git log --stat -M |
| 160 | + git log --stat -M75 |
| 161 | + git log --stat -M --follow -- files/listing.txt |
| 162 | + git log --stat -M75 --follow -- files/listing.txt |
| 163 | + git branch feature |
| 164 | + git commit -m "Ruby lips" |
| 165 | + git checkout feature |
| 166 | + git commit -m "Title" |
| 167 | + git merge feature -m "Merged feature" |
| 168 | + git show feature |
| 169 | + git show master |
| 170 | + gitk --all |
| 171 | + git branch -d feature |
| 172 | + git log --patch |
| 173 | + ll files |
| 174 | + git log -- files/file3.txt |
| 175 | + git log --follow -- files/file3.txt |
| 176 | + git log --patch --follow -- files/file3.txt |
| 177 | + git branch feature2 |
| 178 | + git commit -m "Cursed limbs" |
| 179 | + cat caesar.txt |
| 180 | + git checkout feature2 |
| 181 | + git commit -m "Domestic fury" |
| 182 | + git checkout master |
| 183 | + git merge feature2 -m "Merged" |
| 184 | + git branch -d feature2 |
| 185 | + git branch feature3 |
| 186 | + git commit -m "Blood and destruction" |
| 187 | + git checkout feature3 |
| 188 | + cat chesterton.txt |
| 189 | + git commit -m "Vine" |
| 190 | + git loglive -12 |
| 191 | + git rebase master |
| 192 | + git merge feature |
| 193 | + git merge feature3 |
| 194 | + git branch -d feature3 |
| 195 | + tree |
| 196 | + cd files |
| 197 | + generaterandomchanges 10 random txt |
| 198 | + git rebase -i ce29 |
| 199 | + git reset --hard 7035 |
| 200 | + git reset --hard HEAD@{1} |
| 201 | + git remote add origin https://github.com/githubteacher/rwx.git |
| 202 | + cat .git/config |
| 203 | + git push --set-upstream origin master |
| 204 | + git add chesterton.txt |
| 205 | + git commit -m "Milk" |
| 206 | + git lol -10 |
| 207 | + git config push.default |
| 208 | + git config --global push.default simple |
| 209 | + git diff origin/master |
| 210 | + git reset --hard HEAD^ |
| 211 | + git lol -5 |
| 212 | + git merge origin/master |
| 213 | + git branch -a |
| 214 | + git checkout origin/master |
| 215 | + git checkout master |
| 216 | + git commit -m "Smiley mothers" |
| 217 | + git fetch |
| 218 | + git lol -6 |
| 219 | + export PS1="$ " |
| 220 | + tr.git |
| 221 | + cd scratch/ |
| 222 | + git clone https://github.com/githubstudent/rwx.git |
| 223 | + cd rwx |
| 224 | + git commit -m "Pity" |
| 225 | + git commit -m "Caesar Rage" |
| 226 | + git config --global --unset credential.helper |
| 227 | + git pull https://github.com/githubstudent/rwx.git master |
| 228 | + vi cae |
| 229 | + git reflog |
| 230 | + git commit |
| 231 | + git status |
| 232 | + git push |
| 233 | + git remote add teacher https://github.com/githubteacher/rwx.git |
| 234 | + git pull teacher master |
| 235 | + git config --global credential.helper cache |
| 236 | + git clone https://github.com/githubteacher/rwx.git teacher-rwx |
| 237 | + cd teacher-rwx |
| 238 | + git pull |
| 239 | + ls |
| 240 | + git add caesar.txt |
| 241 | + git commit -m "Havoc and stuff" |
| 242 | + git push |
| 243 | + while :\ndo\nclear\ngit pull\nsleep 1\ndone |
| 244 | + git loglive -6 |
| 245 | + git loglive -5 |
| 246 | + while : do; git pull && git push; sleep 1; done |
| 247 | + while : do; git pull && git push; sleep 1; done; |
| 248 | + git --version |
| 249 | + git config credential.helper |
| 250 | + git config branch.master.rebase true |
| 251 | + git config --global branch.autosetuprebase always |
| 252 | + vi caesar.txt |
| 253 | + git commit -m "Carrion men" |
| 254 | + git pull && git push |
| 255 | + while : do; git pull; sleep 1; done; |
| 256 | + while : do; git pull; sleep 1; done |
| 257 | + while :\ndo\ngit pull\nsleep 1\ndone |
| 258 | + git loglive -10 |
| 259 | + git loglive -8 |
| 260 | + git loglive -7 |
| 261 | + history |
| 262 | + while : git pull; sleep 1\n; |
| 263 | + git branch |
| 264 | + git checkout -b chesterton |
| 265 | + vi chesterton.txt |
| 266 | + git add . |
| 267 | + git commit -m quill |
| 268 | + git lol |
| 269 | + git push --set-upstream origin chesterton |
| 270 | + open .git |
| 271 | + cd code/anxious-cows |
| 272 | + subl . |
| 273 | + ll .git/hooks |
| 274 | + ls .git/hooks |
| 275 | + vi .git/hooks/commit-msg.sample |
| 276 | + pwd |
| 277 | + svn clone https://github.com/githubteacher/rwx |
| 278 | + svn checkout https://github.com/githubteacher/rwx rwx-svn |
| 279 | + cd rwx-svn |
| 280 | + cd .. |
| 281 | + rm -rf rwx-svn |
| 282 | + svn checkout https://github.com/githubteacher/rwx/trunk svn-rwx |
| 283 | + cd svn-rwx |
| 284 | + |
| 285 | + |
| 286 | + |
| 287 | + |
0 commit comments