Skip to content

Latest commit

 

History

History
105 lines (66 loc) · 1.22 KB

Git Command.md

File metadata and controls

105 lines (66 loc) · 1.22 KB

Git Comand To Be Used!

Clone any Repository

  • Copy past this line of code
git clone <GitHub Repository>

Initialise Git

  • Copy past this line of code
git init -b main

add a file

  • Copy past this line of code
git add <file name>

add all files

  • Copy past this line of code
git add .

To view the status

  • Copy past this line of code
git status

To commit

  • Copy past this line of code
git commit -m "commit message"

Add remote

  • Copy past this line of code
git remote add origin <Address of the repository(.git)>

Check remote

  • Copy past this line of code
git remote

check remote url

  • Copy past this line of code
git remote -v

push the repo

  • Copy past this line of code
git push -u origin master

See Log

  • Copy past this line of code
git log

Create Another Branch

  • Copy past this line of code
git branch update

Change Branch

  • Copy past this line of code
git checkout <branch name>