After `chown -R` git is super slow

I have a massive GIT project with several GIT submodules inside. I recursively changed ownership(chown -r) from root to my user for each file in my project.

Now any git command takes a lot of time to complete and seems to use 99% CPU. What is the issue?

I did sudo chown -R my_user my_project/

UPDATE

This seems not to be only GIT related, other terminal commands take a lot of time too. top shows me 100% git usage for like 15 seconds instead of usual 0-1 seconds.


Solution 1:

With the command

sudo chown -R my_user my_project/

you have changed all files in a huge (as you said) repository, therefore your KDE/GNOME/Unity file indexer has a lot of work now. Give the process time to complete its work. Go and drink a coffee ;)

To watch what's happening from an Input/output perspective, install iotop via:

sudo apt-get install iotop

and watch the output of:

sudo iotop