| Command |
Description |
git init |
Initialize a new Git repository |
git clone <url> |
Clone a repository from GitHub |
git status |
Show the working directory status |
git add <file> |
Add file(s) to staging area |
git commit -m "message" |
Commit changes with a message |
git push |
Push changes to remote repository |
git pull |
Fetch and merge changes from remote |
git branch |
List branches |
git checkout <branch> |
Switch to another branch |
git merge <branch> |
Merge a branch into current branch |
git remote add origin <url> |
Add a remote repository |
git log |
Show commit history |
git config --global user.name "Your Name" |
Set your Git username |
git config --global user.email "you@example.com" |
Set your Git email |
git stash |
Stash changes in a dirty working directory |
git diff |
Show changes between commits, commit and working tree, etc. |