Git error building trees when clear cache

Viewed 401

I'm new to Git. i have everything worked before. but the problem came when i try to follow some tutorials regarding .gitignore not woking. Finally i used git clearcache but now i'm getting other error

I used :


git add .

git commit -m "testing gitignore"

git push origin arabic

Error :

You have both vendor/kartik-v/bootstrap-fileinput and vendor/kartik-v/bootstrap-fileinput/.github/CODE_OF_CONDUCT.md
You have both vendor/kartik-v/dependent-dropdown and vendor/kartik-v/dependent-dropdown/.github/CONTRIBUTING.md
You have both vendor/kartik-v/strength-meter and vendor/kartik-v/strength-meter/.github/CONTRIBUTING.md
You have both vendor/kartik-v/yii2-krajee-base and vendor/kartik-v/yii2-krajee-base/.github/CONTRIBUTING.md
You have both vendor/kartik-v/yii2-password and vendor/kartik-v/yii2-password/.github/CONTRIBUTING.md
You have both vendor/kartik-v/yii2-widget-datepicker and vendor/kartik-v/yii2-widget-datepicker/.github/CONTRIBUTING.md
You have both vendor/kartik-v/yii2-widget-depdrop and vendor/kartik-v/yii2-widget-depdrop/.github/CONTRIBUTING.md
You have both vendor/kartik-v/yii2-widget-fileinput and vendor/kartik-v/yii2-widget-fileinput/.github/CONTRIBUTING.md
You have both vendor/kartik-v/yii2-widget-select2 and vendor/kartik-v/yii2-widget-select2/.github/CODE_OF_CONDUCT.md
You have both vendor/kartik-v/yii2-widget-typeahead and vendor/kartik-v/yii2-widget-typeahead/.github/CONTRIBUTING.md
...
error: Error building trees

How i can fix this error ?

I'm unable to push to my repository now.

2 Answers

git clearcache is not a Git command. (Where did you get it?)

The error message suggests that whatever this git clearcache program is, it damaged Git's index. If you don't mind losing the effect of your git add ., you can re-build the index, then re-do the git add, using these basic shell commands:

rm .git/index
git reset
git add .

(this assumes you are at the top level of your repository, so that .git/index names Git's index file). Removing the file and running git reset rebuilds the index from the current commit, destroying the effect of all previous git add and/or git rm commands.

If git clearcache contains such commands, this will also undo its operations, but it looks like that may be necessary.

I had an issue where the directory on windows was in read-only mode

enter image description here

Click properties

enter image description here

Then if read-only is selected - de-select it and hit apply or ok. Next, you should close your IDE and then re-open it and try to make a new commit.

Related