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

后端 未结 24 1461
礼貌的吻别
礼貌的吻别 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:37

    This happened to me when my git remote (bitbucket.org) changed their IP address. The quick fix was to remove and re-add the remote, then everything worked as expected. If you're not familiar with how to remove and re-add a remote in git, here are the steps:

    1. Copy the SSH git URL of your existing remote. You can print it to the terminal using this command:

      git remote -v

    which will print out something like this:

     origin git@server-address.org:account-name/repo-name.git (fetch)
     origin git@server-address.org:account-name/repo-name.git (push)
    
    1. Remove the remote from your local git repo:

      git remote rm origin

    2. Add the remote back to your local repo:

      git remote add origin git@server-address.org:account-name/repo-name.git

提交回复
热议问题