- Talk about SCM in general
- Talk about distributed SCMs
- Talk about origins of git
- created by linus b/c he was sick of perforce
- Git is more than SCM, it's a filesystem
- git init
- talk about .git (verses .svn being everyhere)
- Look at .git/config
- make a new file
- git status
- git add / git status again
- git commit / git status again
- talk about small, atomic commits and why they're good
- git log
- not linear, the repository "version" is an SHA1 hash
- git log -p shows actual diffs
- talk about how a refernce (the SHA1 hash) doesn't need to be the full hsah
- git show
- change the tile
- git add the file (or commit with -a - but avoid that if you can)
- git log again / git log -p again
- git add
- git commit
- git log
-
file system rm
- STILL need to stage that change (can use either ADD or RM confusing*)
- UNSTAGE that change by using git reset HEAD file
-
ASIDE: Talk about .git/HEAD and the concept of HEAD - it's JUST A POINTER TO A REF
-
git rm
- does two steps in one. Removes file from filesystem AND stages the change right away
- undo it the same way, unstage with git reset HEAD , then git checkout -- file
- Adding untracked files
- Staging tracked file changes
- global options
- git config --global alias.st status
- format is "git config [--global] [section].[key] value"
- Branches are a way to explore different ideas
- they bring over unstaged/uncommited changes so you can work in master but decide to make a branch
- You can bring back your changes by merging
- Move to the branch you want to merge TO, then "git merge "
- conflicts
- resolve on merge, then add the file to the staging area and commit to finish it off
- Just a marker for a specific tree state
- Kind of like .git/HEAD
- see them in .git/refs/tags
- git clone pulls down a remote repository and sets all the stuff in .git/config
- git push pushes any commits the remote doesn't yet know about
- every pastie on gist.github.com is a repository
- I created a gist, made a file then pulled down that repo locally
- Made a local change, added/commited it, then pushed it up
- saw the change on the website
- Duncan forked my gist
- Then he cloned from his private url (public urls are read only)
- Made a local change, added/committed/pushed
- I added duncan's public url as a remote on my repo: git remote add duncan git://gist.github.com/69665.git
- Merged in his changes (git merge duncan/master)
- Pushed back to MY gist.