PHP REBOOT 4 Version control is a system which records changes to a file or set of files over time so that you can recall specific versions later. Types of version control systems: Local version control systems Centralized version control systems Distributed version control systems
at a time Locks RCS, SCCS Second Centralized Multi-file Merge before commit CVS, SourceSafe, Subversion, Team Foundation Server Third Distributed Changesets Commit before merge Bazaar, Git, Mercurial Ramesh Dahiya PHP REBOOT 5
in another directory; Simplest but error prone. ‘rcs’ was one of the initial and most popular Local version control systems. This tool basically works by keeping patch sets from one change to another in a special format of disk. Biggest disadvantage: No collaboration, only single developer could work on that. Ramesh Dahiya PHP REBOOT 6
collaboration. It have central server which have all files. Examples are CVS, Subversion, MS VSS etc. Biggest disadvantage: Single point of failure. Ramesh Dahiya PHP REBOOT 7
latest snapshot of the files but they fully mirror the repository. If server fails, any client copy can be used to restore the server. Example Git, Marcurial, Bazaar, Darcs. Ramesh Dahiya PHP REBOOT 8
is a pain. Ramesh Dahiya PHP REBOOT 9 No way to push changes to another user (without submitting to the Central Server) Subversion fails to merge changes when files or directories are renamed. Offline commits are not possible. .svn files pollute local directories. The trunk/tags/branches convention can be considered misleading. Performance and Single point of failure.
files that cannot be easily compressed, the space needed to store all versions of these files can accumulate quickly. If a project has a very long history (50,000 changesets or more), downloading the entire history can take long time and disk space. Ramesh Dahiya PHP REBOOT 10
DVCS BitKeeper. In 2005, that relationship broke as BitKeeper revoke ‘free of charge’ status and Git borned with goals: Speed Simple design Strong support for non-linear branches Fully distributed Able to handle large projects like Linux Kernel efficiently Ensure Integrity Ramesh Dahiya PHP REBOOT 11
Everything is fast Every clone is a backup Work Offline – No network needed for Performing the diff View file history Committing changes Merging branches Obtaining other version of file Switching branches Ramesh Dahiya PHP REBOOT 12
needed, it can be installed with following commands: RedHat based Linux sudo yum install git-core Debian based Linux sudo apt-get install git-core Windows Download installer from code.google.com/p/msysgit Mac brew install git Ramesh Dahiya PHP REBOOT 34
at /etc/gitconfig file. These configuration settings apply to all users. --system option passed to git config command to access system configuration. User specific or global configuration: located at ~/.gitconfig file. This config is applicable to all repositories of single user. --global optn passed tp git config command to access global Repository configuration: located in .git/config file. Apply to single repository. Ramesh Dahiya PHP REBOOT 35
locally but don’t want to commit. Example of such files are: Configuration files IDE files like .nbproject, .subline-project Local documents Libraries of framework To command git not to consider these files, we simple create file '.gitignore‘ can commit it at the root. Ramesh Dahiya PHP REBOOT 42
mark important points of software, like versions. Listing tags: git tag Listing tags with patterns git tag -l "1.2.*" Git support two type of tags Annotated tags – can give a message with tag. (Lightweight) tags Ramesh Dahiya PHP REBOOT 50
other commit, we need to push them to remote repository. Command git push origin tagname If we want to push all local tags, command is git push origin --tags Ramesh Dahiya PHP REBOOT 52
development and continue to do work without messing with that main line. Branching in most SCM is expansive process. Some people believe branching in Git is its Killer Feature. The way Git branches is incredibly lightweight. Ramesh Dahiya PHP REBOOT 53
already have two commits. ----------------- Now say you have to work on mantis issue 53 (just for example) Lets create iss53 branch. Ramesh Dahiya PHP REBOOT 54