cannot lock refs/remotes/origin/xxx/xxxx : ‘refs/remotes/origin/xxx’ exists
error: Cannot lock refs/remotes/origin/xxx/xxxx: refs/remotes/origin/xxx exists
This issue usually occurs when there are 2 branches with conflicting names. Suppose let us say you have a branch “Dev” and when you have another branch with a name something like “dev/hotfix”, then the above issue might occur when you are trying to build a new branch.
Solution: The best solution for this issue is to rename the new branch with uppercase or lowercase like the existing branch that starts with the similar name.
Suppose if there is a “Dev” branch and you are trying to build “dev/Test” then rename the “dev/Test” to something like “Dev/Test1” and build the branch again.. in that case you wont face any Git failure issues