Git Manager
Quick Commands
Status & Info
git status # Show working tree status
git status -s # Short format
git log --oneline # Compact commit history
git log --graph # Visual graph
git diff # Show unstaged changes
git diff --cached # Show staged changes
Committing
git add <files> # Stage specific files
git add . # Stage all changes
git commit -m "feat: add new feature"
git commit -m "fix: resolve login bug"
git commit -m "docs: update README"
git commit --amend # Amend last commit
Branching
git branch -a # List all branches
git checkout -b feature/name # Create and switch
git checkout main # Switch branch
git branch -d feature/name # Delete branch
Sync
git fetch # Fetch remote changes
git pull # Pull remote changes
git push # Push local commits
git push -u origin branch # Push and track
Stashing
git stash # Stash changes
git stash list # List stashes
git stash pop # Apply and drop
Conventional Commits
Follow these prefixes:
feat:- New featurefix:- Bug fixdocs:- Documentation onlystyle:- Formatting, no code changerefactor:- Code restructuretest:- Adding testschore:- Maintenance
Pull Request Workflow
- Create branch:
feature/short-description - Make changes and commit
- Push:
git push -u origin feature/short-description - Create PR from remote URL
Undo Operations
| Action | Command |
|---|---|
| Unstage file | git reset HEAD <file> |
| Undo commit (keep changes) | git reset --soft HEAD~1 |
| Undo commit (discard changes) | git reset --hard HEAD~1 |
| Revert commit | git revert <commit-hash> |