Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresponsive git status, diff, add (hanging)

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?

like image 905
yunque Avatar asked Apr 10 '17 09:04

yunque


People also ask

Why does git status hang?

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.

Why is git diff not showing anything?

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.

What is difference git add * git add?

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.

What does diff mean in git?

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.


1 Answers

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.

like image 71
Antoni Avatar answered Sep 21 '22 08:09

Antoni