Synopsis of revision control basics and Git.
Also available in presentation mode…
Revision Control
Other names
- version control
- source control
- software configuration management
What is it?
A way to track changes to computer files, often with the capability of collaboration. It is used in software coding, word processors like google docs, wiki’s, content management, CAD, etc. It is basically a more advanced “undo” button. Most often used with human readable files but can be used with other types too.
Distributed vs Client-Server models
Collaborative work on the same file. How can two people open the file at the same time and work on it? This capibily has only just been introduced: google docs, google wave, the upcoming gedit, etc. So how has it traditionally been handled?
- Client server
- All the files are stored on a central server and must be either checked out leaving the file locked to others or many people can check them out and the changes must be merged after the edits. Merging is difficult with files that aren’t basic text.
- Distributed
- Everyone’s copy is a repository that can be copied by others. No central server, so the operations on the files are much faster.
Resources
Software
- Wikipedia’s list: http://en.wikipedia.org/wiki/List_of_revision_control_software
Open source
Proprietary
Git
Git was written to manage the Linux sourcecode after Bitkeeper wasn’t available to use anymore.
Features (from Version Control with Git by Jon Leoliger)
- Distributed development
- For thousands of developers
- Fast performance
- Data integrity
- Accountability
- Immutability
- Atomic transactions
- Encourage branched development
- Complete repositories
- Clean internal design
- Free, as in freedom
Resources
- Github – Social coding website base base on Git
- Gitweb – Show your git repo to the world from your server
- Gitwiki – The Git project wiki
- Gitmagic – Tutorial and documentation
- Git Webcast by Scott Chacon – Introductiong to Git
- Version Control with Git by Jon Leoliger – Great book
- Cheat sheets: One, Two, Three
- A visual git reference
- http://library.edgecase.com/git_immersion/index.html
Tutorial
- Concepts
- Repos
- Object types: Blobs, Trees, Commits, Tags
- SHA1 Hash
- The index
- Init and Clone
- Adding
- Commiting
- Branches
- Diff
- Merges
- Remote Repositories
Example commands
- Three basic startup commands: init, add, commit
- find ., .git/objects
- commit, commit -am “message”
- ls-files -s, –stage
- cat-file -p <HASH> – shows what the file is
- write-tree
- status
- log, log -1 –pretty=oneline
- show
- show-branch
- rm, mv
- blame
- checkout
- branch
- diff
- merge
Git + Matlab
- Simply type: system(‘command’) where ‘command’ is the git command you would type in the shell.
- http://manuraghavan.net/?p=22