Member-only story

How to fix Git getting stuck or hanging for long periods of time?

Steven Rescigno
1 min readMay 22, 2023

--

Are you having an odd issue with your Git not working?

Sometimes your Git CLI may start to take to long or maybe even hang after a few commands…

This has happened on multiple occasions.

Here are some debugging you can do to troubleshoot you Git issues.

How to clean Git on your computer?

First try running the following command on your computer to fix an odd hanging in your git CLI.

git clean -f -n

If this still doesn’t work try using the following command on your computer to clear out duplicate Git Objects.

How to remove duplicates for your Git Objects?

We can run the following command to clean up git duplicates before we send them over to Github.

Try running the following command to clean up some Git Objects on your local computer.

git gc

Hope you find these tips helpful and save you tons of time when working with Git.

Happy Coding!!

P.S. If you’re a fan of Medium as much as we are, consider supporting me and the thousands of other writers on Ko-Fi.

It only costs $8 for a coffee, and it supports us writers. Thank you, Greatly.

--

--

Steven Rescigno
Steven Rescigno

Written by Steven Rescigno

Designer | Developer | Medium Author

No responses yet