Reputation: 937
I am using git locally. Within a directory, let's call it Project, I initialized a git respository. As I created/modified files I used 'git add file' and 'git commit'. The files were now becoming a mix of two seemingly separate projects, so I put project1 files into a subdirectory we'll call Project1, and project2 files into a subdirectory we'll call Project2. I changed the parent directory name from Project to Project12.
After doing all this, I realized I was neglecting to think about my git repository, so I moved all the files back into the directory Project12 along side Project1 and Project2, with plans to 'git add --all' before I moved them back into their respective subdirectories.
But when I used 'git add --all', git stalled. Nothing happened except a blinking cursor on the next line for an unseemly amount of time. 'Git status' had a messy assortment of deletes and new files from all the moving around. I though I would try to clear the staging area, then add/commit. From what research I did I tried 'git reset'. Not only did this not resolve the stalling after 'git add --all', but now git stalls after 'git status', with the blinking cursor on the next line.
I don't want to 'git reset --hard' because there are some files I have changed but not committed, so I don't want to lose these changes. I tried 'git stash', but this also stalls.
I should add that i can still 'git add file', but there are quite a few files, and I would ultimately like to know what is wrong.
I am somewhat new to git, so if someone could please explain what they think is going on here, I would be appreciate this. I'm not sure what output to paste at this point because I'm just getting a blinking cursor.
The goal is to put files into their respective subdirectories and continue adding/committing to the same branch.
Thank you!
Upvotes: 3
Views: 3408
Reputation: 11
This issue is mostly caused by directories and sub-directories that have large files in them. You should use a heuristic approach as to how you deal with such situation. To determine the particular directory use the verbose tag(-v) with the git add command.
Upvotes: 1
Reputation: 937
There was a data file that was so big it was stalling git. Since the data file was created each time the program ran, deleting the data file was an option, and this fixed the stalling.
Upvotes: 3
Reputation: 1324278
One way to get out of this messy situation is to:
git add -A
there.The idea is to not keep to much time in the original repo which seems a bit unstable, and check if the issue persist in a freshly cloned repo.
Upvotes: 2