| Command | Description | Example |
|---|---|---|
git init |
Initialize a new Git repository | git init |
git clone |
Clone a repository into a new directory | git clone https://github.com/user/repo.git |
git add |
Add file contents to the index | git add . (all files) |
git commit |
Record changes to the repository | git commit -m "Commit message" |
git status |
Show the working tree status | git status |
| Command | Description | Example |
|---|---|---|
git branch |
List, create, or delete branches | git branch feature-branch |
git checkout |
Switch branches or restore files | git checkout main |
git merge |
Join two or more development histories | git merge feature-branch |
git rebase |
Reapply commits on top of another base | git rebase main |
| Command | Description | Example |
|---|---|---|
git push |
Update remote refs along with objects | git push origin main |
git pull |
Fetch from and integrate with another repository | git pull origin main |
git remote |
Manage set of tracked repositories | git remote add origin URL |
git fetch |
Download objects and refs from another repository | git fetch origin |