Basic Commands
git initInitialize a new Git repository
git clone <url>Clone a repository
git statusCheck working directory status
git add .Stage all changes
git commit -m "<message>"Commit staged changes
git push origin <branch>Push to remote repository
git pull origin <branch>Pull from remote repository
Branching
git branchList branches
git branch <name>Create a new branch
git checkout <branch>Switch to a branch
git checkout -b <branch>Create and switch to new branch
git merge <branch>Merge branch into current branch
git branch -d <branch>Delete a branch
Advanced
git rebase <branch>Rebase current branch
git stashStash current changes
git stash popApply stashed changes
git reset --hard HEAD~1Reset to previous commit
git log --onelineView commit history (compact)