Your AI says it committed but GitHub is empty
Agents in Cursor, Bolt, Replit, and similar tools often report “Committed!” when they only created a local git commit. GitHub stays empty until something pushes that commit to a remote. Those are two different steps.
Commit vs push (in one line)
- Commit = save a snapshot in the
.gitfolder on the machine (or container) that ran the command. - Push = send that snapshot to a host like GitHub (
origin).
If the agent never pushed — or never had a remote — your GitHub repo can look untouched even though git log locally is busy.
1. Is there a remote at all?
git remote -v
You want something like:
origin https://github.com/you/your-app.git (fetch)
origin https://github.com/you/your-app.git (push)
If the list is empty, add the GitHub repo (create it on GitHub first if needed):
git remote add origin https://github.com/YOU/YOUR-REPO.git
Use the SSH URL instead if that is how you authenticate.
2. Do you have local commits that GitHub does not?
git status
git branch -vv
git log --oneline -5
If a remote tracking branch exists:
git fetch origin
git log --oneline origin/main..HEAD # commits you have that origin/main does not
# or, if your default branch is master:
git log --oneline origin/master..HEAD
git status lines like “Your branch is ahead of ‘origin/main’ by 3 commits” mean the AI (or you) committed locally and nothing has pushed yet.
3. Push
git push -u origin HEAD
Or name the branch explicitly: git push -u origin main.
If push is rejected, read the error: you may need to pull/rebase first, fix auth (HTTPS credential or SSH key), or you may be pushing to a repo you do not have write access to.
4. Confirm on GitHub
Open the repository in the browser, select the branch you pushed, and check Commits. The SHAs should match git log --oneline locally.
Common vibecoding gotchas
- Agent worked in a disposable environment (preview VM, old Replit cycle, cloud agent sandbox). The commit lived there; your laptop clone never saw it. Push from the environment that has the commit, or copy the changes into a clone that has
origin. - Wrong folder. The agent committed in a subdirectory or a second clone.
pwdandgit rev-parse --show-toplevelbefore you panic. - Commit succeeded, push failed silently in the agent transcript (auth prompt, protected branch). Scroll up for
! [rejected]orPermission denied. - Empty GitHub repo, local has history — usually “never pushed.” GitHub has history, local is empty — you cloned the wrong URL or a fresh folder without
git pull.
Quick checklist
| Check | Command / action |
|---|---|
| Remote configured | git remote -v |
| Ahead of GitHub | git status / git log origin/main..HEAD |
| Auth works | git ls-remote origin |
| Publish | git push -u origin HEAD |
| Verify | GitHub → branch → Commits |
Still stuck after a real push error? That is a good moment for a Rescue if the app is also failing deploy or auth — but for “commits not on GitHub,” the fix is almost always remote + push, not a rewrite of your app.