Report abuse


			
*Getting Git*
*Scott*
* gitcasts.com

*What is*
* stupid content tracker
* tree history stupidly and well - can be rearranged really well
* the porcelain - cmd that are used all the time
* the plumbing - lots more that we don't need to use
* !svn - not an evolution
* dag vs. delta - store all or only differences


*How it works*
* git directory is the heart of it
* you only have 1, and it can be anywhere
* inside - config, hooks, index, obj database, references
* SHA1 stored in objdb, zip and stored - this is a 'loose object'
* git gc will clean up the files and delta compresses them with hash file indexes and deletes all the loose one - this is a 'packed file'
* object types:
** blob - every file packed
** tree - directories and links to blobs - like unix inode
** commit - points to a root tree (of tree and blob) at point in time, author and commiter - parent is nothing or previous commit
** taq - message, who did, what's being tagged
* objects are completely immutable - old ones stay - you add new ones
* references - lightweight pointers to commits - they can be moved around - stored in .git/refs/
* Making a new commit changes the pointers up the tree, so they all have to be changed up the tree.  Keeps blobs that have not changed.  If you do change, you have to write the new block.  If stuff under hasn't changed, it points to the unchanged one instead of creating a new one.
* On checkout - it gets the ref for a file, gets the SHA, finds the objects, find pointer to commit, the to tree then to blobs
* History - checkout marks what you took and then creates a new branch at that spot so you can go forward from there.  Its acyclic back through time.
* Merge creates a tree with 2 parents
* You can create new branches off your master so that you can try things out, take parts from the tree and then blow it away if you like w/o changing the master
* You have a private repo which can you push public.  You merge w/ others via their public repos.  You can mix and match what you have and what they have.
* You can clone a repo as a start point, make changes and push to a public repo to share.  There are many public repos and you get take what you want
* It keeps master pointers for each repor you get from

*Rebasing*
* Like merge but not.
* Instead of merge - creates new object taking from the divergence point, the patch files and puts them on top of where they were.  So its a linear history.  You abandon your original commits but get the new stuff.

*Treeish*
* Full SHA to get an object
* Partial SHA, if unique, will figure out which one
* Date Spec - different for different repos - SHA's always the same
* OrdinalSpec - which parent you want
* Tree, Blob - one, or ranges on each
* Tree nav with ~ and ^

*Local*
* The Index - in working directory, but you can move it and create many to try new stuff
* you can mark what get committed so you don't push everything up
** Object Dir - base
** Index - what files have been changes and are different and what should be added/updated, etc..
** Working Directory - where you do your work

*Using it*
* 152 commands  total - 43 porcelain to on cmd line
* git.or.cz
* wget, make, make install - update cause its being changed all the time

* setup - with your email address and user name - can be global or per project

* get clone - gets a repo, can use ssh://, http[s]://, git://, file:///
* init repo - cd project_dir, git init, git add, git commit
* .gitignore - stuff you don't want - set up first!
* git status - what's up?
* git add _file_  working to the index
* git commit - index to repo
* git log (--pretty=...) - history of commits
* git diff - gives a patch, one tree to another
* patch to apply the file made by git diff
* git format-path, git am < ..patch to keep author info
* git-send-mail 
* git-am < mbox
* used to patch rails ( see the slides for doing this)

* branch, merge, rebase
* master branch - for prod
* dev branch - get merged to master if it works
* topic branch - do it for a scrum story, then merge into dev
* git branch, git show-branch
* git checkout -b idea
* see slides for commands on how to do this
* delete topic branches when moved back in

*Sharing*
* git remote
* git remote add #name url_git_hub
* git push #name #branch
* git clone ... to get source
* git remote show ...
* see slides - too fast!!

* pull = fetch + merge - you can do them one at a time to see what's up
* git push

* Popular Workflows *
* shared repository - central with developers pulling, pushing with synch'ing
* dictator - one guy has control of the repo ups, downs can be done by other.  There are lieutenants on top of tongs of developers to send to the dictator
* github model - ppl can fork and do what they want  but the is a central person for the 'real' one

*Deploy*
* slides for capistrano config

*Ruby+git*
* grit, git gem and git-ruby - github.com/schacon/
* wrappers to access git repos

*Learn More*
* http://www.gitcasts.com/git-talk
* gitcasts.com
* git.or.cz
* email him for stuff - schacon@gmail.com
* del.icio.us/popular/git
* peep code