Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spelling errors in commit and what to do if "ahead by 1 commit"

Tags:

git

I committed something and realize my comment had a spelling error, so I typed git commit -m "xxx" again, with corrected comment.

As a result, I can't push anything as git push says

Everything up-to-date

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit. 
#
nothing to commit (working directory clean)

What can I do now?

like image 638
Tyra Avatar asked Dec 28 '22 04:12

Tyra


1 Answers

git rebase -i origin/master will give you the opportunity to correct the commits you have beyond your upstream repository. Then you can git push the result.

like image 94
Phil Miller Avatar answered Feb 16 '23 02:02

Phil Miller