Git Girish
Git VCS that I have used ClearCase, cvs, svn Happy p4 user
From git.or.cz Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.
You say... Whoa! Eh, what? So?
One Frequently creating backup files Someone interrupts my work I changed my mind to do something else I want to try another approach I want to make an unrelated “change”
Two The “Big” commit problem I cannot commit until it's done Tracing a problem Branching appears heavy When revisiting my own code
Three Share code with someone I can mail the patch, but this is a hassle UI review – It's only a mockup, not commit material. Code review of big changes - It's easier to explain how I implemented step by step.
Four Speed Speed fucks with your mind. The speed of your tool controls how you think. Distraction Bisecting and branching are unthinkable for me
Five Merge hell Merges often result in conflicts Every merge loses history What are the commits that are being merged? If you periodically merge two branches, you will keep getting conflicts
Six Many minor annoyances In p4, you have to open before edit svn leaves.svn everywhere Cannot work offline
Git So what's this git thingie anyway? Git history
Git Git revisits some of the fundamental assumptions of version control Why is everything on a a server? Space? Power? Incredibly, 14 years of development history can be crunched into under 2 GB. Solution: Keep everything local
Git Don't track files, track content Blobs, trees, commits, branches/tags
Git Consequences of git's repo structure: It's local. It's your repo. Branching is practically a no-op Create a branch whenever you start working on any task Modify your local commits at will (amend, rebase, squash, split) Cherry pick between branches It's blazing fast
Git Sharing changes Why make it centralized? Anyone should be able to pick branches changes from anyone. Solution: Remotes. Add as many as you like (social coding) Svn can be a remote (git-svn)
Git Merge problems Arise because the history of most vcs do not record a merge Solution: Store the commits that created the merge. Tools like annotate can work on originator as opposed to commiter
Git Let's go over all my problem again
One Frequently creating backup files Someone interrupts my work (stash) I changed my mind to do something else (branch) I want to try another approach (branch) I want to make an unrelated “change” (stash, add -i)
Two The “Big” commit problem Because I cannot commit until it's done (commit locally early, often. No one will see your embarassing commits) Tracing a problem (smaller commits are easy to debug) Branching appears heavy (almost a no-op) When revisiting my own code
Three Share code with someone For review (UI, code). I can mail the patch, but the receiver has to deal with merge problems (other person can pull my changes or I can push) For code review, it's easier to explain how I implemented step by step (small commits, easier review)
Four Speed The speed of your tool controls how you think. Distraction Every tried bisecting? Branching? It's fast.
Five Merge hell Merges often result in conflicts Every merge loses history What are the commits that are being merged? If you periodically merge two branches, you will keep getting conflicts Merge commits in git have multiple parents using which history can be tracked and results in better merge.
Git But wait there's more Staging Undo (reflog) Signed tags (for security) Git has a tool for every occasion
Summary Freedom Supports different workflows One is not restricted by the tool It's fast, so we think differently Quality Don't merge until it's ready Commit early, commit often. Easy to track problems. Use it, to appreciate it better.