Git and nasty “error: cannot lock existing info/refs fatal”

后端 未结 24 1446
礼貌的吻别
礼貌的吻别 2020-11-30 15:58

After cloning from remote git repository (at bettercodes) I made some changes, commited and tried to push:

git push origin master

Errors

24条回答
  •  温柔的废话
    2020-11-30 16:45

    I saw this error when trying to run git filter-branch to detach many subdirectories into a new, separate repository (as in this answer).

    I tried all of the above solutions and none of them worked. Eventually, I decided I didn't need to preserve my tags all that badly in the new branch and just ran:

    git remote remove origin
    git tag | xargs git tag -d
    git gc --prune=now
    git filter-branch --index-filter 'git rm --cached -qr --ignore-unmatch -- . && git reset -q $GIT_COMMIT -- apps/AAA/ libs/xxx' --prune-empty -- --all
    

提交回复
热议问题