Git Rename Limit

I encounter a git issue when I run these commands, they are used to sync up with origin/master:

1
2
3
4
5
6
7
8
9
git_clean() {
git reset --hard HEAD
sed -i -e 's/^\(\*[ ][ ]*text.*\)/#\1/' .gitattributes
git status
git clean -fdx
git checkout -- .
sed -i -e 's/^#\(\*[ ][ ]*text.*\)/\1/' .gitattributes
git status
}

I get errors:

1
2
3
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 12454 and retry the command.
Automatic merge failed; fix conflicts and then commit the result.

Try to set rename.limit to larger value and run commands again but that does not help, https://stackoverflow.com/questions/4722423/how-to-merge-two-branches-with-different-directory-hierarchies-in-git

1
2
3
git config merge.renameLimit 999999
git merge --abort
git config --unset merge.renameLimit

So far these commands help:

1
2
3
4
5
6
7
8
git reset --hard origin/master
git fetch -p
git pull origin master

## if failed again, run
git merge --abort
git reset --hard origin/master
git pull origin master
0%