DEV Community

Cover image for How To Fix A Stuck GitHub Push

How To Fix A Stuck GitHub Push

dev_neil_a on August 29, 2022

Introduction Diagnosing the Issue Cause of the Issue Solution Step 1. Checking the Commit Log Step 2. Reset the Commit to the Last Pushed Commi...
Collapse
 
jordanaf808 profile image
jordanaf808

I had a similar issue, although the changes I was pushing were very small. I reset back to a known good commit and tried to push it to remote, but it wouldn't let me because there were remote changes I needed to pull first. After pulling those changes (which wasn't a problem), I was able to push up my local changes.

Collapse
 
inchworks profile image
inchworks

Thanks - this cleared the stuck push to GitHub on my MacBook M1. I don't think git should hang in this way with modest file sizes, but I see unresolved reports of this problem on Apple silicon. Were you using an M1 Mac?

Collapse
 
dev_neil_a profile image
dev_neil_a

It sucks that it hangs like it does without any kind of error or warning in the logs.

In terms of the machine I was / am on, it's an Intel-based Macbook Pro. I have had this issue on multiple platforms before so it's not an Apple Silicon specific issue.

Collapse
 
inchworks profile image
inchworks

That's awkward. I'm building a personal website using Hugo deployed via GitHub to a free Vercel account. So far it's gone well, but I planned to include a photo gallery. If I can't push photos to GitHub reliably, then that part of the project is a non-starter.

Collapse
 
codenkoffee profile image
Hatem Soliman

Yeah M2 here

Collapse
 
brandonmichaelhunter profile image
Brandon Michael Hunter

Thank for sharing. I had a similar experience with my django app and the problem was that I was trying to save my ".venv" folder into github. Once I added my ".venv" to my gitignore file, then I was successful for posting my changes to github.

Thanks again.

Collapse
 
jcubic profile image
Jakub T. Jankiewicz

You don't need to use git log and copy the hash to remove last commit. You can use:

git reset HEAD~1
Enter fullscreen mode Exit fullscreen mode

This will do the same.

Collapse
 
yuridevat profile image
Julia 👩🏻‍💻 GDE

You saved my life! 🙏

Faced the same problem using MacBook Air M1 macOS Venture v13.1 when trying to push img created with R Studio.

Thank you for this detailed explanation on how to fix the problem.

Collapse
 
dev_neil_a profile image
dev_neil_a

👍👍

I'm glad it was useful and solved your problem. It is always images that cause this problem everytime!!

Collapse
 
codenkoffee profile image
Hatem Soliman

My solution that I came up with was to do
git push --all origin

Collapse
 
johnmoses profile image
John Moses

Thanks for such detailed problem solving approach. It has helped me solve a two-weeks old problem.
Thank you