Git FAQ

Find answers to the most commonly asked Git questions. From basic commands to advanced workflows, get help with Git version control.

What is Git?

Basics
git
version control
basics

How do I initialize a new Git repository?

Getting Started
init
repository
setup

How can I clone an existing repository?

Getting Started
clone
repository
download

What is a commit in Git?

Basics
commit
snapshot
history

How do I stage and commit changes?

Basic Commands
add
commit
stage

How do I check the status of my repository?

Basic Commands
status
check
working directory

How do I create a new branch?

Branching
branch
create
checkout

How do I merge branches?

Branching
merge
branch
combine

How do I resolve merge conflicts?

Branching
conflict
merge
resolve

How do I undo the last commit?

Undoing Changes
undo
reset
commit

How do I discard local changes?

Undoing Changes
discard
checkout
reset

How do I remove a file from tracking but keep it in the working directory?

File Management
remove
untrack
keep file

How do I set up a remote repository?

Remote Operations
remote
origin
setup

How do I push changes to a remote repository?

Remote Operations
push
remote
upload

How do I pull changes from a remote repository?

Remote Operations
pull
remote
download

How do I revert a commit that has been pushed?

Undoing Changes
revert
undo
pushed

How do I configure my Git username and email?

Configuration
config
username
email

How do I view the commit history?

Basic Commands
log
history
commits

How do I stash changes?

Advanced
stash
temporary
save

How do I remove a remote branch?

Remote Operations
delete
remote
branch

What is Git rebase and when should I use it?

Advanced
rebase
linear history
clean

What's the difference between merge and rebase?

Advanced
merge
rebase
difference

What is .gitignore and how do I use it?

File Management
gitignore
ignore
untracked

Still Need Help?

Use our interactive scenario calculator to build the perfect Git command for your situation