The following git commands hang (do not respond) in one of my repositories:
git status git diff git stash git add
The fact that I cannot git add
leads me to believe that the unresponsiveness isn't simply due to very large files. Since git stash
also hangs, I don't think it's merely a problem with communicating with origin.
git remote show origin
shows the expected remote URL. I'm working on a branch and have checked that it has not been renamed. (FWIW, the origin is hosted on bitbucket.)
All the above commands respond as expected in a different repo, so it's not due to the internet connection.
Any other tips for troubleshooting this?
If you are using Windows, check to see if some Windows process has some file or files in that repository locked. If so, your git command will wait for that other process to release the lock, before proceeding. If that other process never lets go, Git never proceeds.
There is no output to git diff because Git doesn't see any changes inside your repository, only files outside the repository, which it considers 'untracked' and so ignores when generating a diff.
git add -A command will add all modified and untracked files in the entire repository. Whereas git add . will only add modified and untracked files in the current directory and any sub-directories.
Comparing changes with git diff Diffing is a function that takes two input data sets and outputs the changes between them. git diff is a multi-use Git command that when executed runs a diff function on Git data sources. These data sources can be commits, branches, files and more.
For whatever it's worth, try git fsck
(as per one of the comments) then git gc
. When runninggit status
and git commit
, they where hanging for me after processing a number of files; and running those commands fixed the issue. I don't which command actually fixed the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With