Skip to content

About

This Cheatsheet helps to host a project repository on github.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Top Useful Git commands: Everyone must know these commands.

Download Now

Git

Initialize

git config --global user.name [your name]
git config --global user.email [youremail@example.com]
git init

Create a file

touch .gitignore

Track files

git add [file-name] 
git add -A

Unstaging files

git rm --cached [filename] 
git reset [file name] 

Commit and Status

git commit -m "[commit name]" 
git status 
git log 
git log -p -1

Compare the last commit

git checkout [filename] 
git checkout -f

from Staging area and Working directory

git diff 
git diff --staged 
git commit -a -m "[commit name]" 

Remove a file

git rm [filename] 
git rm --cached [filename] 

Working with branch

git branch [branch name] 
git checkout [branch name] 
git branch - M [new branch name] 
git branch 
git checkout -b [branch name] 
git merge [branch name] 

Working with remote repoistory

git remote add origin [URL.git] 
git remote -v 
git remote set-url origin [URL.git] 
git push origin [branch name] 
git push -u origin [branch name]
git push 
git pull 

Clone a repo

git clone [UR.git] [folder name] 

🔗 Connect with me

linkedin

Instagram

About

This Cheatsheet helps to host a project repository on github.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors