Version Control allows us to easily... • revert files to a previous state • revert project to a previous state • compare changes between file versions • see who last modified a file • recover when things go wrong
method of manually duplicating and renaming files • how most people keep backups (versions) of their work # Advantages • simple • no setup / training # Disadvantages • error prone / easily messy • single point of failure # Examples • Local Hard Drive
client-server approach • a single server that contains all the versioned files • a number of clients that check out files from the server # Advantages • good for collaborative development • everyone works on the same files # Disadvantages • single point of failure • always-on internet connection / slow server = slow work # Examples • Subversion (SVN)
peer-to-peer approach • each peer has a complete working copy and history of project # Advantages • great for collaborative development • multiple backups of project • no internet (work done locally then pushed to server) • can be used for more than just code (Photoshop files too!!) # Disadvantages • more complex / setup and training # Examples • Git, Mercurial
Benefits of using a VCS • encourages better organization • enables better collaborative work • maintains a detailed history of a project • easily recover from failures / errors • easier to try experimental code with a project • ...so many more reasons!
• installed on your local machine and run from command line • full repository and history on local machine • used in conjunction with preferred editors / IDE (Dreamweaver) # Integrity • project integrity (snapshots, not differences) • data integrity (checksums) # Additions Only • git generally only adds data (that is committed) • freedom to experiment without loss
(repo) • [n] the .git directory that stores all version control information, history, and files # Commit • [n] a single point in the git history • [v] the act of storing a project’s current state in the repo # HEAD • [n] pointer to the most recent commit
- creates a new git repository • add - stages either a new or edited file to the INDEX • commit - stores a snapshot of project’s current state • status - shows any changes to the working directory • pull - fetches and merges from a remote repo • push - updates a remote repo with local changes
• hosted git repos • built for collaborative development • “central” collaborative point • ensured backup of code • ability to deploy locally from remote repo to multiple servers [dev, live, staging, etc] • integrated issue tracking • web-based editor for quick-fixes
# Create GitHub Account • Sign up for FREE GitHub account [github.com] • Add SSH Key to GitHub [help.github.com/articles/set-up-git] # Install Git on Computer • git-scm.com/download] # Install GUI for Development • Mac [mac.github.com] • Windows [code.google.com/p/msysgit] • More GUIs listed in RESOURCES