What is Git

 Git is a Distributed Version Control system(DVCS). It lets you track changes made to a file and allows you to revert back to any particular change that you wish.

It is a distributed architecture that provides many advantages over other Version Control Systems (VCS) like SVN. One of the major advantages is that it does not rely on a central server to store all the versions of a project’s files.

Instead, every developer “clones” a copy of a repository I have shown in the diagram with “Local repository” and has the full history of the project available on his hard drive. So when there is a server outage all you need to do to recover is one of your teammate’s local Git repository.

There is a central cloud repository where developers can commit changes and share them with other teammates.

Few Git commands

git rm [file] -  deletes the file from your working directory and stages the deletion.

git log  - list the version history for the current branch.

git show [commit] - shows the metadata and content changes of the specified commit.

git tag [commitID]  - used to give tags to the specified commit.

git checkout [branch name] - used to switch from one branch to another.

git checkout -b [branch name] - creates a new branch and also switches to it.

No comments:

Write a program in PHP to reverse a number

A number can be written in reverse order. For example 12345 = 54321 <?php   $ num = 23456;   $ revnum = 0;   while ($ num > 1)   {   $...