Skip to content

Instantly share code, notes, and snippets.

@pushcx
Created October 9, 2013 01:43
Show Gist options
  • Save pushcx/6894846 to your computer and use it in GitHub Desktop.
Save pushcx/6894846 to your computer and use it in GitHub Desktop.
Intro to Git Workshop for Chicago Web Professionals 2013-10-08
Intro to Git
------------
Peter Harkins @pushcx http://push.cx
These notes will be available at http://gist.github.com/pushcx/ .... (TBD end
of prez)
If you haven't yet installed Git and want to follow along the exercise, visit:
http://git-scm.com/downloads
The WiFi network is named "BooCoo" and the password is "blackcoffee"
Please look behind you - my business card and stickers are on a stool for you
Git isn't GitHub
BitBucket
Heroku -git based webhosting
a repository is one project
~/.tmp $ mkdir gitintro
~/.tmp $ cd gitintro/
~/.tmp/gitintro $ git init .
global config file ~/.gitconfig
git config --global user.name "John Doe"
git config --global user.email [email protected]
git config --global color.ui auto
git help config
per-project ~/.git/config
edit a file
git status
git add actors
git status again
git commit -m "message"
git diff <filename or directory>
git log
Git commits are named as hashes to uniquely identify them and know that
no one has edited history
git checkout
change to a specific version of the project in the past, or a different
branch
'detached HEAD' is OK, it just means you're not a the latest commit in a
branch
git checkout -b music
to create and check out a new branch based on whatever the current commit
is
# and then do some work, adding and commit
git checkout master
git merge music
a merge conflict means two people tried to edit the same thing in both
branches
git push
share your work with others
git fetch
copy down any remote commits
git pull
fetch + merge
git help remote
git clone
copy a remote repo to this computer
GUIs
gitk
Tower - really nice and friendly, very visual
TortoiseGit
GitHub for Windows is good
there are many more
## Resources
http://try.github.io - an in-browser walkthrough tutorial - super helpful
- Official Git Documentation: http://git-scm.com/documentation
The Book is good, and there are excellent resources available in the
External Links: http://git-scm.com/documentation/external-links
- Git Cheatsheet: https://github.com/nerdgirl/git-cheatsheet-visual
A printable one-page guide to git. Hang this at your desk.
- Git Cheatsheet: http://ndpsoftware.com/git-cheatsheet.html
An interactive guide to the commands that move data around in git.
- Visual Git Reference: (http://marklodato.github.com/visual-git-guide/index-en.html
A more detailed guide to git
- http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
How to write good commit messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment