GIT
GIT
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