Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Git and Github: Tips and tricks
Search
Wendy Liu
November 26, 2013
Programming
400
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git and Github: Tips and tricks
Presentation for HackMcGill. Intro to Git/Github plus various tips and tricks, all in one.
Wendy Liu
November 26, 2013
More Decks by Wendy Liu
See All by Wendy Liu
Git and Github: Version control for a happier you
dellsystem
0
360
Optimising your JavaScript
dellsystem
1
550
Git and Github: version control for the 21st century
dellsystem
1
330
Django: The web framework for perfectionists with deadlines
dellsystem
0
440
Git and GitHub: an introduction
dellsystem
2
280
What's in a name? Using first names as features for gender inference in Twitter
dellsystem
1
510
diva.js: A web-based document viewer for high-resolution images
dellsystem
0
370
Other Decks in Programming
See All in Programming
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
200
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
180
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
260
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
340
AI時代のUIはどこへ行く?その2!
yusukebe
21
7.2k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
160
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.1k
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
190
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
140
Vite+ Unified Toolchain for the Web
naokihaba
0
310
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
350
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Faster Mobile Websites
deanohume
310
31k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
360
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
140
Game over? The fight for quality and originality in the time of robots
wayneb77
1
200
30 Presentation Tips
portentint
PRO
1
330
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Skip the Path - Find Your Career Trail
mkilby
1
150
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Transcript
HackMcGill :: January 29, 2014 tips & tricks and :
about me - Wendy Liu - 4th year Math &
CS - 3 years experience with Git - 137-day Github commit streak - dellsystem on Twitter, Github, IRC
what is git?
what is git? version control system!
svn/perforce: local vs. remote comparison to other systems
svn/perforce: local vs. remote hg/bzr: faster, more control comparison to
other systems
svn/perforce: local vs. remote hg/bzr: faster, more control cvs/rcs: no
comparison comparison to other systems
backup_dec_1_2012.zip backup_dec_8_2012.zip backup_dec_15_2012.zip backup_dec_22_2012.zip backup_dec_29_2012.zip backup_jan_5_2012.zip backup_jan_12_2012.zip backup_jan_19_2012.zip backup_jan_26_2012.zip
report_v1.doc report_v2.doc report_v3.doc report_v4.doc
keeps track of changes enter git.
keeps track of changes extremely flexible enter git.
keeps track of changes extremely flexible developed by linus torvalds
enter git.
keeps track of changes extremely flexible developed by linus torvalds
completely free to use (and open source!) enter git.
keeps track of changes extremely flexible developed by linus torvalds
completely free to use (and open source!) primarily command-line enter git.
website what is github?
website collaborative coding, via git what is github?
website collaborative coding, via git (mostly) free to use what
is github?
website collaborative coding, via git (mostly) free to use major
part of developer ecosystem (esp. OSS) what is github?
why git?
why git? diffs
why git? diffs backups
why git? diffs backups collaboration
what git can do for you versioning easy collaboration blame
tracking down bugs safe experimentation statistics
what github can do for you issue-tracking even easier collaboration
remote backups access your files from anywhere graphical, easy-to-use UI
now: how git works
repository directory on filesystem just metadata (changes) manual grouping of
changes
commit group of logically-related changes 1 or more files (add/delete/modify)
staging index CHANGES I WANT IN MY NEXT COMMIT ALL
THE OTHER CHANGES
git commit -m 'test' CHANGES I WANT IN MY NEXT
COMMIT ALL THE OTHER CHANGES a new commit, with message 'test'
CHANGES I WANT IN MY NEXT COMMIT ALL THE OTHER
CHANGES the commit with message 'test' (nothing here yet)
your computer REMOTE REPOSITORIES LOCAL REPOSITORY some server another server
github
now: git tips
rebasing git rebase -i [start commit] reorder, reword, edit, squash
commits
amending git commit --amend staged changes become part of previous
commit
force pushing git push origin master -f useful after amending/rebasing
multiple remotes git remote add origin [url] git remote add
upstream [different URL] useful when pulling from other developers
patch git add --patch stage one chunk at a time
diffing git diff (unstaged) git diff --cached (staged) git diff
--check (whitespace errors)
colours git config --global color.ui auto
fix your whitespace git stripspace git apply --whitespace=fix
good commit messages Fix bug (50 chars max, capitalised, imperative)
Longer description explaining what the commit does. Wrap at 72 characters. Don't forget the blank line. bit.ly/gitcommit
bisect git bisect (or, "when did this bug first appear?")
ignoring .gitignore (untracked files) git update-index --assume-unchanged (tracked files) git
status --ignored
better pulls git pull vs git fetch & git merge
aliases git s = git status git add = git
add --patch git ds = git diff --staged git amend = git commit --amend git say = git commit -m git un = reset --soft HEAD^1
fixing merge conflicts 1. Don't panic 2. git status 3.
Look for the <<< 4. Stage & commit
moving files git mv [source] [destination] instead of: mv [source]
[destination] git rm [source] git add [destination]
sensitive data help.github.com/articles/remove-sensitive-data
selective staging git add --update (only tracked files) git add
--all (all files)
view configuration git config --list
pushing to remotes git push origin master git push origin
localbranch:remotebranch git push origin :remotebranch (deletes it)
branch tracking git push origin master -u git push origin
local:remote -u
stashing edits git stash git stash apply git stash pop
(applies, then removes from stack)
fixing mistakes git checkout (undo edits) git reset --soft (keeps
edits) git reset --hard (loses edits)
merge strategies git merge --strategy=[strategy] strategies: recursive (default), ours, theirs,
etc
now: github tips
keyboard shortcuts press ? to bring up the help
issues in commits "Fix #54" -> closes issue #54 from
the commit "For #54" -> links to #54 from commit, & vice versa
all from your browser edit, commit, send a pull request
... all without leaving your browser
blame who introduced this line, and when, and why
file rendering markup, geoson, csv, and more
integration with travis continuous integration (automated testing)
thanks! git-scm.com/book help.github.com