Git cannot lock ref 'HEAD': unable to resolve reference HEAD

后端 未结 10 1479
情深已故
情深已故 2020-12-15 16:57

I\'m trying to commit the changes to my repository but I receive the error below:

git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F C:\\U         


        
10条回答
  •  借酒劲吻你
    2020-12-15 17:09

    Navigate to directory

    .git/refs/heads/branch_name

    delete the preferred branch name

    then open terminal(git bash or cmd for windows)

    git reset
    

    then commit the changes (if necessary)

    then run the following command for merging the remote repository branch

    git pull
    

    if it gives related to refusing to merge unrelated histories

    then, run the following command in the terminal

    git pull origin master --allow-unrelated-histories
    

    this solution solved my problem

提交回复
热议问题