Back to Resources
Laravel
Cheatsheet
Git Commands Cheatsheet
Essential Git commands reference untuk daily development workflow
Bash
0 views
Code
## Git Commands Cheatsheet
Essential Git commands for daily workflow.
### Basic Commands
**Initialize & Clone**
```bash
git init
git clone <url>
```
**Status & Changes**
```bash
git status
git diff
git log --oneline
```
**Stage & Commit**
```bash
git add .
git commit -m "message"
git commit --amend
```
### Branching
**Create & Switch**
```bash
git branch <branch-name>
git checkout -b <branch-name>
git switch <branch-name>
```
**Merge & Delete**
```bash
git merge <branch-name>
git branch -d <branch-name>
```
### Remote Operations
**Push & Pull**
```bash
git push origin <branch>
git pull origin <branch>
git fetch
```
**Remote Management**
```bash
git remote -v
git remote add origin <url>
```
### Undo Changes
```bash
git reset HEAD~1
git revert <commit-hash>
git stash
git stash pop
```
### Advanced
**Rebase**
```bash
git rebase <branch>
git rebase -i HEAD~3
```
**Cherry Pick**
```bash
git cherry-pick <commit-hash>
```
Related Resources
Related resources feature coming soon