Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

push to remote repo gives the error - there are still refs under

Tags:

git

I am trying to push code to a remote repo -

git push uat release/1.1:release
Counting objects: 4047, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1679/1679), done.
Writing objects: 100% (4047/4047), 3.38 MiB | 1.79 MiB/s, done.
Total 4047 (delta 2160), reused 3666 (delta 1909)
remote: Switched to branch 'release'
To ubuntu@ubuntu-jvm:/repos/tms/uat
 * [new branch]      release/1.1 -> release
error: there are still refs under 'refs/remotes/uat/release'
error: Cannot lock the ref 'refs/remotes/uat/release'.

How do I resolve the above error.

like image 938
murtaza52 Avatar asked Jun 28 '12 13:06

murtaza52


1 Answers

I suspect you have other branches named release/<something> on your uat remote. The push command you are running is trying to convert a local branch release/1.1 into a remote branch release, but the remote refuses to remove release/<something> because that would lose information. Try git push uat release/1.1:newrelease or something similar to avoid the conflict of trying to have a single branch named the same thing as a "subdirectory" containing other branches (it's not truly a subdirectory, but the way git works internally, it is sometimes stored as an actual subdirectory).

git remote show uat or git branch -r will show you what branches your uat remote has.

like image 91
twalberg Avatar answered Oct 02 '22 15:10

twalberg