About Version Control System :-
Before we start more about Version Control System lets see what is Version Control System (Revision Control or Source Control system). – Version Control System or Revision Control or Source Control system is the management of changes to files in large websites, computer programs, and other collections of information. It is most commonly used in website development, where more than one developers are working on same project or files. In that case, changes are usually identified by a number or letter code, termed the “revision level”,”revision number”, or simply “revision”.Main features of Version Control (with an example of git command line)
1) Backup and Restore Backup and Restore are simple. It means git will backup our file and we can restore that backup file whenever we need in future. 2) Synchronisation It’s pretty easy for all members of the project to syncs their file changes with other members. 3) Short-term undo If you mixed in your file and you need previous changes back then go back to the last version. 4) Long-term undo Sometimes we mess up very badly. Suppose you made a change a month ago, and it had a bug. Just jump back to the old version, and see what changes were made on that day. 5) Track Changes When you made any changes in the file and add to git you can add specific message about changes you did at the time of commit your files on git. So you can easily track your changes by that message. 6) Track Ownership VCS add every changes with a name of the user who makes changes so you can easily track the name of a user with specific changes. 7) Branching and merging If you have any specific task which is going to take more time to complete and you want to do those changes after completion of other tasks, then you can create a branch for this task and merge in your main branch when it is fully completed.Basic Functionality Of Git
Config
Configure your git account with your system Command: git config –global user.name “Your name” git config –global user.email “[email protected]”
Init
Create a new local git repository. Command: git init
Clone
check out of exiting git repository in your local system. Command : git clone /path/to/repository or git clone username@host:/path/to/repository
Status
List the changes file which is still needed to commit. Command: git status
Add
add one or more changed file. Command : git add or git add * (add all changes)
Commit
commit your added changes to head (it’s in your local not remote repository yet) Command: git commit -m “Any message” (add a message for specific commit so you can track it later) or git Commit -a (commit any files you’ve changed since then)
Push
Add changes to your remote repository Command: git push origin master (push on master branch) or git push origin <Branch Name>
Remote
check or connect to your remote repository Command: git remote -v (list of all your remote repository) or git remote add origin (Add the remote repository to your existing folder or project)
Branches
Create, Switch, Push into Branches