- git init: Initialize a new Git repository.
- git clone [url]: Clone an existing repository.
- git branch: List all branches in your repository.
- git branch [branch-name]: Create a new branch.
- git checkout [branch-name]: Switch to a branch.
- git checkout -b [branch-name]: Create a new branch and switch to it.
- git merge [branch-name]: Merge a branch into the active branch.
- git branch -d [branch-name]: Delete a branch.
- git status: Show the working directory status.
- git add [file]: Add a file to the staging area.
- git add .: Add all files to the staging area.
- git commit -m "[commit message]": Commit changes with a message.
- git commit -a: Commit all changes with a message.
- git remote add origin [url]: Add a remote repository.
- git remote -v: List all remote repositories.
- git push [remote] [branch]: Push a branch to a remote repository.
- git pull [remote]: Pull changes from a remote repository.
- git fetch [remote]: Fetch changes from a remote repository.
- git log: Show the commit history.
- git log --oneline: Show the commit history in a single line per commit.
- git log --graph --oneline: Show the commit history with a graph.
- git reset [file]: Unstage a file.
- git checkout -- [file]: Discard changes in a file.
- git revert [commit]: Create a new commit that undoes changes in a previous commit.
- git reset --hard [commit]: Reset your repository to a previous commit and discard all changes since.
- git tag [tag-name]: Create a tag.
- git tag: List all tags.
- git show [tag]: Show information about a tag.