| name | git-helper |
| description | Version control made simple for vibecoders. Use when user asks about git, commits, branches, pushing, pulling, undoing changes, merge conflicts, or says things like "save my work", "go back to before", "I messed up git", "how do I undo", or needs to collaborate on code. |
Git Helper
Git commands translated for vibecoders.
The Only Commands You Really Need
Save Your Work
git add .
git commit -m "describe what you changed"
Upload to GitHub/Remote
git push
Download Latest Changes
git pull
Common Tasks
"I want to save a checkpoint before trying something risky"
git add .
git commit -m "checkpoint before trying X"
"I want to undo what I just did"
Undo last commit but keep the changes:
git reset --soft HEAD~1
Throw away all uncommitted changes:
git checkout .
Undo changes to a specific file:
git checkout -- path/to/file.js
Go back to how it was on GitHub:
git fetch origin
git reset --hard origin/main
"I want to see what changed"
git status
git diff
git diff --staged
git log --oneline -10
git show HEAD
"I want to work on something separate"
git checkout -b my-new-feature
git add .
git commit -m "my changes"
git push -u origin my-new-feature
"I want to get someone else's branch"
git fetch origin
git checkout their-branch-name
"I want to merge my branch into main"
git checkout main
git pull
git merge my-new-feature
git push
Fixing Mistakes
"I committed to the wrong branch"
git reset --soft HEAD~1
git stash
git checkout correct-branch
git stash pop
git add .
git commit -m "your message"
"I need to change my last commit message"
git commit --amend -m "new message"
"I want to add something to my last commit"
git add .
git commit --amend --no-edit
"Git says I have merge conflicts"
- Open the file with conflicts
- Look for lines with
<<<<<<<, =======, >>>>>>>
- Keep the code you want, delete the markers
- Save the file
git add . then git commit -m "resolved conflicts"
"Git won't let me pull"
git stash
git pull
git stash pop
git add .
git commit -m "my changes"
git pull
"I'm in 'detached HEAD' state"
Don't panic. Just:
git checkout main
If you have changes you want to keep:
git checkout -b save-my-work
"I want to completely start over"
git fetch origin
git reset --hard origin/main
⚠️ This throws away ALL local changes
"I accidentally deleted a file"
git checkout HEAD -- path/to/deleted/file.js
"I need to grab just one commit from another branch"
git cherry-pick <commit-hash>
Working with Stash
Save changes for later (named):
git stash push -m "work in progress on feature X"
See all stashes:
git stash list
Restore a specific stash:
git stash pop stash@{0}
git stash pop stash@{1}
Delete a stash:
git stash drop stash@{0}
Daily Workflow
Start of day:
git pull
While working (save often):
git add .
git commit -m "what I did"
End of day:
git push
Branch Cleanup
Delete local branch:
git branch -d branch-name
git branch -D branch-name
Delete remote branch:
git push origin --delete branch-name
See all branches:
git branch -a
Quick Reference
| I want to... | Command |
|---|
| Save work | git add . && git commit -m "msg" |
| Upload | git push |
| Download | git pull |
| Undo last commit | git reset --soft HEAD~1 |
| Throw away changes | git checkout . |
| New branch | git checkout -b branch-name |
| Switch branch | git checkout branch-name |
| See status | git status |
| See history | git log --oneline |
| Save for later | git stash |
| Get saved work back | git stash pop |
| See what changed | git diff |
| Abort merge | git merge --abort |
GitHub-Specific
Clone a repo:
git clone https://github.com/user/repo.git
Add a remote:
git remote add origin https://github.com/user/repo.git
See remotes:
git remote -v
Create repo from existing folder:
- Create empty repo on GitHub (no README)
- Then:
git init
git add .
git commit -m "initial commit"
git remote add origin https://github.com/user/repo.git
git push -u origin main