Skip to content

Can't push a commit

Agah edited this page Nov 11, 2020 · 1 revision

Remember pulling the latest changes to your local!

Whenever you push a commit to the main branch, GitHub actions will push a few more for you after that.

This is why the HEAD of your repository is going to be ahead of your local copy. If you forget pulling the remote changes, then modify some files --> add --> commit, git won't allow you to push those changes to remote w/o pulling the latest changes first.

This is not the end of the world, you just need to deal with vim a bit :)

  • git pull
  • Press i
  • Press esc
  • Press : to go to the end of the page
  • Type wq and hit enter
  • git push

But if you can ensure that your local is always up-to-date with the remote before making changes, you won't have to do any of these!

Clone this wiki locally