0% found this document useful (0 votes)
7 views1 page

GIT

How to install GIT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

GIT

How to install GIT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

GIT

It was introduced in 2005 by Linus Torvalds. It is a distributed version control


system that enables developers to collaborate seamlessly. There are several other
version control systems such as Bitbucket, Github, etc.

Commands
1. git init - to initialise an empty git repository in a particular project or
folder path
2. git add <name of file> - to add a file to the staging area or to stage a file
3. git add . - to add all files in the working directory to the staging area
4. git commit -m "commit message" - to take a snapshot of your commit
5. git config --global user.email "your email" - to register your email address
(one time)
6. git config --global user.name "your name" - to register your name (one time)
7. git status - to check the current state of your staged files
8. git log - to check a list of all commits
9. git checkout <commit id> - to switch between different commits
10. git branch <branch name> - To create a new branch
11. git checkout -b <branch name> - To create a new branch and switch automatically
to the created branch
12. git branch - to list all your branches
13. git checkout <branch name> - to switch between branches
14. git merge <branch name> - to merge an existing to another branch

You might also like