What is GIT, Installing GIT and Few basic commands used in GIT:
GIT :
* GIT is created by "Linus Torvald" ( the person who created the Linux Kernel) in year 2005
* GIT is a distributed version control system
* The difference between a Centralized and Distributed Version control Systems ?
In case of Centralized Version Control System there will be only one Centralized server which have all the information , because of one centralized server the data will be at high risk. As the server crashes then all the data stored in server will be crashed which is a high risk to the company.
In order to overcome the problem Distributed Version Control System came to existence. Where the data will be available both in local and central repo. In case the central repo crashes, we can backup the data from local repo.
Advantages of GIT:
1. It is a distributed version control system.
2. GIT follows Truck base development , which means the developers can create different branches and later on merge it into the master.
3. Though the internet is not available the developers can write their code in local repo and later they can push to central repo when they are connected to internet.
4. Snapshots will be available
5. it keeps the track of code history
6. Changes can be revert back anytime.
Installing GIT in windows:
$ sudo apt-get update
$ sudo apt-get install git -y
(SUDO means Super User do)
Basic Commands in git:
git init ( creates an empty folder)
git --version( once git got installed we can see the version)
touch test1 ( file test1 can be created)
git config --global user.name 'user name'
git config -- global user.email 'user mail id' ( by these commands we can add the user name and mailid)
git add test1( the file test1 can be added from working tree to staging)
git commit - m "my first commit" ( the changes can be added from staging to local repository)
git status ( it shows the status of files and directories)
git log ( to check the history)
echo "hello" >> test1 ( we can write the data into test1 file)
Comments
Post a Comment