Git Commands
1. Clone Git Repository to your local machine
git clone https://github.com/yourrepository2. Git create a branch
git checkout -b hotFix3. Git remove a file
git rm "file name"4. Git add all edited files to queue
git add .5. Remove from add
git reset6. Commit changes
git commit -m "Your Message"7. Create new repo
git init8. Clone remote repo
git clone <url>9. Show changes
git status10. Stage a file
git add <file>11. Stage all changes
git add .12. Commit staged changes
git commit -m "msg"13. Stage tracked + commit
git commit -am "msg"14. Compact history view
git log --oneline --graph15. Show unstaged changes
git diff16. Show staged vs last commit
git diff --staged17. List branches
git branch18. Create branch
git branch <name>19. Switch branch
git switch <name>20. Create + switch
git switch -c <name>21. Old way to switch branch
git checkout <name>22. Delete branch
git branch -d <name>23. Show remotes List all configured remotes
git remote -v24. Update current branch
git pull25. Rebase instead of merge
git pull --rebase26. Push current branch
git push27. First push + set upstream
git push -u origin <branch>28. Merge into current
git merge <branch>29. Rebase onto branch
git rebase <branch>30. Apply specific commit
git cherry-pick <commit>31. Discard local changes
git restore <file>32. Unstage all staged files in the current directory
git restore --staged33. Unstage file
git restore --staged <file>34. Unstage file
git reset <file>35. Reset everything to last commit
git reset --hard HEAD36. Undo commit with new commit
git revert <commit>37. Change commit message
git commit --amend38. Stash changes
git stash39. List stashes
git stash list40. Apply + remove stash
git stash pop41. List tags
git tag42. Create tag
git tag <name>43. Push tag
git push origin <name>44. Show public history
git log -g45. Show private history
git reflog46. Remove untracked files/dirs
git clean -fd