Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git cannot lock ref, cannot create ref [duplicate]

I get this error:

fatal: cannot lock ref 'refs/heads/oleg/feature/1535693040/squashed':

'refs/heads/oleg/feature/1535693040' exists; cannot create 'refs/heads/oleg/feature/1535693040/squashed'

the script that generated the error was:

current_branch="$(git rev-parse --abbrev-ref HEAD)"

git checkout -b "$current_branch/squashed"
git reset --soft "remotes/origin/dev";

git add .
git add -A
git commit -am "ores/gitflow auto-commit (squashed)"
git push

anyone know what that is about?

like image 858
Alexander Mills Avatar asked Aug 31 '18 23:08

Alexander Mills


1 Answers

Ahh I found an answer to this: https://stackoverflow.com/a/22630664/1223975

in short, if: a/b/c exists, Git cannot create a/b/c/d

not sure why tho

like image 64
Alexander Mills Avatar answered Oct 20 '22 00:10

Alexander Mills