### Getting Started

- [Installing Git](/git/install-git)
- [Getting started with Tower](/git/tower)

### Fundamentals

- [Creating a repository](/git/creating-a-repository)
- [Committing file changes](/git/committing-file-changes)
- [Ignoring unwanted files](/git/ignoring-files)
- [Viewing historical changes](/git/viewing-previous-commits)
- [Publishing local changes](/git/publishing-local-changes)
- [Cloning an existing repository](/git/cloning-an-existing-repository)
- [Reverting and undoing commits](/git/reverting-commits)
- [Cherry-picking commits](/git/cherry-picking-commits)

### Advanced

- [How to create branches and merge them using Git](/git/branching-and-merging)
- [How to deploy a website using Git](/git/deploy-websites-with-git)
- [Git for Developers: Tips and tricks](/git/git-for-developers)
- [Managing Large Files with Git LFS](/git/managing-git-lfs-and-deployhq)
- [Mastering Git Commit Messages with AI](/git/mastering-git-commit-with-ai)
- [Best Practices for Committing AI-Generated Code](/git/committing-ai-generated-code)
- [Resolving Merge Conflicts with AI](/git/resolving-merge-conflicts-with-ai)
- [Generating Changelogs and Release Notes with AI](/git/generating-changelogs-with-ai)
- [AI-Powered Code Review Before Committing](/git/ai-code-review-before-committing)
- [Writing Pull Request Descriptions with AI](/git/writing-pull-request-descriptions-with-ai)
- [Using AI in Git Hooks for Pre-Commit Checks](/git/ai-git-hooks)
- [Removing Large Files from Git History](/git/removing-large-files-from-git-history)
- [Creating branches](/git/creating-a-branch)

### Commands

- [git branch](/git/commands/branch)
- [git status](/git/commands/status)
- [git checkout: Switch Branches, Restore Files & Detached HEAD](/git/commands/git-checkout)
- [git merge](/git/commands/git-merge)
- [git log](/git/commands/git-log)
- [git stash](/git/commands/git-stash)
- [git tag](/git/commands/git-tag)
- [git fetch](/git/commands/git-fetch)
- [git pull](/git/commands/git-pull)
- [git push](/git/commands/git-push)
- [git remote](/git/commands/git-remote)
- [git submodule](/git/commands/git-submodule)
- [git add](/git/commands/add)
- [git commit](/git/commands/git-commit)
- [git diff](/git/commands/git-diff)
- [git init](/git/commands/git-init)
- [git clone](/git/commands/git-clone)
- [git reset: Soft, Mixed & Hard Reset Examples (with Recovery)](/git/commands/git-reset)
- [git rebase](/git/commands/git-rebase)
- [git cherry-pick](/git/commands/git-cherry-pick)
- [git config](/git/commands/git-config)
- [git blame](/git/commands/git-blame)

### FAQs

- [How do I delete a branch in Git?](/git/faqs/how-to-delete-a-branch-in-git)
- [How can I remove a large file from my commit history?](/git/faqs/removing-large-files-from-git-history)
- [How do I manage files that are in the path of a previous Git submodule?](/git/faqs/add-files-git-submodule-path)
- [How to resolve merge conflicts](/git/faqs/resolve-merge-conflicts-git)
- [How to move a subdirectory into a separate Git repository](/git/faqs/detatch-subdirectory-git-submodule)
- [How do I authenticate with GitHub when pushing commits?](/git/faqs/cache-github-credentials-pushing-commits)
- [How can I change the author of multiple Git commits?](/git/faqs/update-author-committer-multiple-git-commits)
- [How do I rename a branch in Git?](/git/faqs/rename-a-branch-in-git)
- [How do I squash multiple commits into one?](/git/faqs/squash-multiple-commits-git)
- [git reset vs git revert: The Difference (with Decision Rule)](/git/faqs/difference-git-reset-revert)
- [How do I recover a deleted branch in Git?](/git/faqs/recover-deleted-branch-git)
- [How are "git fetch" and "git pull" different?](/git/faqs/difference-between-git-fetch-and-git-pull)
- [How do I clone a specific branch in Git?](/git/faqs/clone-specific-branch-git)
- [How do I use AI to write better git commit messages?](/git/faqs/ai-git-commit-messages)
- [How do I review AI-generated code before committing?](/git/faqs/review-ai-generated-code-before-committing)
- [How do I resolve merge conflicts with AI assistance?](/git/faqs/resolve-merge-conflicts-with-ai)
- [How do I generate a changelog from my git history using AI?](/git/faqs/generate-changelog-git-ai)
- [How do I add AI-powered checks to my git pre-commit hooks?](/git/faqs/ai-pre-commit-hooks-git)
- [How can I clean up deleted branches?](/git/faqs/how-to-clean-up-deleted-branches)
- [What is a "detached HEAD" in a Git repository?](/git/faqs/what-is-git-detached-head)
- [How do I undo my last commit?](/git/faqs/undo-last-git-commit)
- [How can I edit my last commit message?](/git/faqs/edit-last-commit-message)
- [How can I revert a Git repository to a previous commit?](/git/faqs/revert-git-repository-previous-commit)
- [How do I undo the most recent local commits in Git?](/git/faqs/undo-recent-commits-git)
- [How can I make Git “forget” about a file that was tracked but is now in .gitignore?](/git/faqs/forget-tracked-files-gitignore)

Menu[Learn Git](/git)/Commands
# Git Commands

Learn what each Git command does and see examples of the different ways you can use them.

[
### git branch
](/git/commands/branch)[
### git status
](/git/commands/status)[
### git checkout: Switch Branches, Restore Files & Detached HEAD
](/git/commands/git-checkout)[
### git merge
](/git/commands/git-merge)[
### git log
](/git/commands/git-log)[
### git stash
](/git/commands/git-stash)[
### git tag
](/git/commands/git-tag)[
### git fetch
](/git/commands/git-fetch)[
### git pull
](/git/commands/git-pull)[
### git push
](/git/commands/git-push)[
### git remote
](/git/commands/git-remote)[
### git submodule
](/git/commands/git-submodule)[
### git add
](/git/commands/add)[
### git commit
](/git/commands/git-commit)[
### git diff
](/git/commands/git-diff)[
### git init
](/git/commands/git-init)[
### git clone
](/git/commands/git-clone)[
### git reset: Soft, Mixed & Hard Reset Examples (with Recovery)
](/git/commands/git-reset)[
### git rebase
](/git/commands/git-rebase)[
### git cherry-pick
](/git/commands/git-cherry-pick)[
### git config
](/git/commands/git-config)[
### git blame
](/git/commands/git-blame)

Close
### Getting Started

- [Installing Git](/git/install-git)
- [Getting started with Tower](/git/tower)

### Fundamentals

- [Creating a repository](/git/creating-a-repository)
- [Committing file changes](/git/committing-file-changes)
- [Ignoring unwanted files](/git/ignoring-files)
- [Viewing historical changes](/git/viewing-previous-commits)
- [Publishing local changes](/git/publishing-local-changes)
- [Cloning an existing repository](/git/cloning-an-existing-repository)
- [Reverting and undoing commits](/git/reverting-commits)
- [Cherry-picking commits](/git/cherry-picking-commits)

### Advanced

- [How to create branches and merge them using Git](/git/branching-and-merging)
- [How to deploy a website using Git](/git/deploy-websites-with-git)
- [Git for Developers: Tips and tricks](/git/git-for-developers)
- [Managing Large Files with Git LFS](/git/managing-git-lfs-and-deployhq)
- [Mastering Git Commit Messages with AI](/git/mastering-git-commit-with-ai)
- [Best Practices for Committing AI-Generated Code](/git/committing-ai-generated-code)
- [Resolving Merge Conflicts with AI](/git/resolving-merge-conflicts-with-ai)
- [Generating Changelogs and Release Notes with AI](/git/generating-changelogs-with-ai)
- [AI-Powered Code Review Before Committing](/git/ai-code-review-before-committing)
- [Writing Pull Request Descriptions with AI](/git/writing-pull-request-descriptions-with-ai)
- [Using AI in Git Hooks for Pre-Commit Checks](/git/ai-git-hooks)
- [Removing Large Files from Git History](/git/removing-large-files-from-git-history)
- [Creating branches](/git/creating-a-branch)

### Commands

- [git branch](/git/commands/branch)
- [git status](/git/commands/status)
- [git checkout: Switch Branches, Restore Files & Detached HEAD](/git/commands/git-checkout)
- [git merge](/git/commands/git-merge)
- [git log](/git/commands/git-log)
- [git stash](/git/commands/git-stash)
- [git tag](/git/commands/git-tag)
- [git fetch](/git/commands/git-fetch)
- [git pull](/git/commands/git-pull)
- [git push](/git/commands/git-push)
- [git remote](/git/commands/git-remote)
- [git submodule](/git/commands/git-submodule)
- [git add](/git/commands/add)
- [git commit](/git/commands/git-commit)
- [git diff](/git/commands/git-diff)
- [git init](/git/commands/git-init)
- [git clone](/git/commands/git-clone)
- [git reset: Soft, Mixed & Hard Reset Examples (with Recovery)](/git/commands/git-reset)
- [git rebase](/git/commands/git-rebase)
- [git cherry-pick](/git/commands/git-cherry-pick)
- [git config](/git/commands/git-config)
- [git blame](/git/commands/git-blame)

### FAQs

- [How do I delete a branch in Git?](/git/faqs/how-to-delete-a-branch-in-git)
- [How can I remove a large file from my commit history?](/git/faqs/removing-large-files-from-git-history)
- [How do I manage files that are in the path of a previous Git submodule?](/git/faqs/add-files-git-submodule-path)
- [How to resolve merge conflicts](/git/faqs/resolve-merge-conflicts-git)
- [How to move a subdirectory into a separate Git repository](/git/faqs/detatch-subdirectory-git-submodule)
- [How do I authenticate with GitHub when pushing commits?](/git/faqs/cache-github-credentials-pushing-commits)
- [How can I change the author of multiple Git commits?](/git/faqs/update-author-committer-multiple-git-commits)
- [How do I rename a branch in Git?](/git/faqs/rename-a-branch-in-git)
- [How do I squash multiple commits into one?](/git/faqs/squash-multiple-commits-git)
- [git reset vs git revert: The Difference (with Decision Rule)](/git/faqs/difference-git-reset-revert)
- [How do I recover a deleted branch in Git?](/git/faqs/recover-deleted-branch-git)
- [How are "git fetch" and "git pull" different?](/git/faqs/difference-between-git-fetch-and-git-pull)
- [How do I clone a specific branch in Git?](/git/faqs/clone-specific-branch-git)
- [How do I use AI to write better git commit messages?](/git/faqs/ai-git-commit-messages)
- [How do I review AI-generated code before committing?](/git/faqs/review-ai-generated-code-before-committing)
- [How do I resolve merge conflicts with AI assistance?](/git/faqs/resolve-merge-conflicts-with-ai)
- [How do I generate a changelog from my git history using AI?](/git/faqs/generate-changelog-git-ai)
- [How do I add AI-powered checks to my git pre-commit hooks?](/git/faqs/ai-pre-commit-hooks-git)
- [How can I clean up deleted branches?](/git/faqs/how-to-clean-up-deleted-branches)
- [What is a "detached HEAD" in a Git repository?](/git/faqs/what-is-git-detached-head)
- [How do I undo my last commit?](/git/faqs/undo-last-git-commit)
- [How can I edit my last commit message?](/git/faqs/edit-last-commit-message)
- [How can I revert a Git repository to a previous commit?](/git/faqs/revert-git-repository-previous-commit)
- [How do I undo the most recent local commits in Git?](/git/faqs/undo-recent-commits-git)
- [How can I make Git “forget” about a file that was tracked but is now in .gitignore?](/git/faqs/forget-tracked-files-gitignore)

