0% found this document useful (0 votes)
5 views

GIT-and-GITHUB

Git is a distributed version-control system designed for tracking changes in files, particularly for software development. It offers benefits such as easy file recovery and the ability to identify issues, and it supports various types of version control systems including local, centralized, and distributed. The document also provides installation instructions, basic commands, and features of Git, along with links to resources for further assistance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

GIT-and-GITHUB

Git is a distributed version-control system designed for tracking changes in files, particularly for software development. It offers benefits such as easy file recovery and the ability to identify issues, and it supports various types of version control systems including local, centralized, and distributed. The document also provides installation instructions, basic commands, and features of Git, along with links to resources for further assistance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Version Control

System GIT

JANUARY 01
GIT
Version Control System

Git is a distributed version-control system for tracking changes in any set of files,
originally designed for coordinating work among programmers cooperating on source
code during software development.

Benefit:

Easily Recover File


Who Introduce Issue and When
Roll Back To Previous Working State

Type of Version Control:

Local Version Control system


Centralized version control system
Distributed Version Control system

Local Version Control System:


The version control system in which user can create and install their own local
version control system on there own personal system or environment.

{Bidirectional DATA Base}

DATA BASE USER

Benefit:

Something is better that nothing

Drawback:

Only accessible for one user


Share is possible only manually
If we lose the system, we can loss all data
Centralized Version Control System:

This is the version control system in which we can create a central data base on
server and multiple users can access that version control system. But while
access (Pull & Push) version control system it only pulls the latest version of
software and changes. And in case if user loss their data they will fetch it from
server but is server is damage entire data or software are vanished.

User Cand do pull/push but


they can only pull the latest
version not entire repo source
code.

Server USERS

Distributed Version Control System:

This is the version control system in which we can pull/push the data
from the server. But in this when we are going to pull the any repository it pull entire
source code of the repository (pull entire repository). So, if the global repository will
not work or damage. We can easily recover the entire data and if some time server is
damage, we can also configure and restore the backup easily.

For example… GitHub, Bitbucket etc.

GIT
This is the distributed version control system. By using this we can manage the
version change history. In general word we can say that it track the version change.

Benefit:
Easily Recover File
Who Introduce Issue and when
Roll-back to previous working stat
Features:
Snapshot capture not difference
Almost every operation is local
Git has integrity {Show the checksum via tool to check the actual data}
Git generally only add data

Installation of GIT

Installation on Windows

To install on windows, we can use the git official website


https://git-scm.com/

Click on Download
and Download the
exe setup file
After .exe download, we can follow the normal app installation file
process on windows. After installation we can get two things

i. GIT Command Line Tool


ii. GIT Bash
Installation on Linux:

To install we can use below command for linux..


#yum install git

To check Git is installed or not we can just check the Git version by using
below command.
#git –version

Git Command: -
To make a directory as a working directory of git
#git init

To Configure the Git

#git config --global user.name “ShailAdmin”


#git config –global user.email [email protected]

To check the git status


#git status

To add file into staging area


#git add filename {For single file}
#git add . Add all available file in one go
#git add –a
To git commit :
#git commit -m “Commit message should be here”

Git Logs:-
To check the commit, we can check the git logs.
#git log

To check the change in details we can use below command


#git log -p

#git log --stat


#git log --pretty=online/short/full
#git log --since=2.day/month/week
#git log --pretty=formate “%h -- %an”

To Download the entire gir repository


#git clone repo-url

To ignore any file or directory


I. Create .gitignore file
II. And add the name of file or directory which we want to ignore in our project

To check the difference between staging area and last commit


#git diff
#git diff –staged
To delete file or directory
#git rm -rf filename/DirectoryName
To rename file or Directory
#git mv filename/DirectoryName
To make file or directory untracked
#git rm –cached filename/DirectoryName

Git Remote Repository..


To manage the remote repository we can use multiple hosting source like
github, bitbuket etc
GitHub https://github.com/
BitBucket https://bitbucket.org/product/

To Add git remote repository to terminal


#git remote add origin( we can give any Name) repo_url

To push date to global git repository.


#git push origin master

To Create new branch


#git checkout -b branchName

To check available branch


To switch to branch
#git checkout branchName

To merge branch
#git merge BranchName

To push local branch to remote repository


#git push origin BranchName

To delete branch
#git -d BranchName
#git -D BranchName
To Delete branch from remote repository
#git -d origin BranchName

For output of test command on linux terminal follow the below git repository
For any other Help follow the official Git website : Git

Git Cheat Sheet url : Git CheatSheet

Thank You..

You might also like