1

Using Git I created a local branch called "Development/TOTS" and tried to push it to a remote repo.

There was already a remote branch called "Development", and I got this error after the push:

$ git push origin Development/TOTS Total 0 (delta 0), reused 0 (delta 0) To https://git-codecommit.ap-southeast-2.amazonaws.com/v1/repos/my_repo * [new branch] Development/TOTS -> Development/TOTS error: update_ref failed for ref 'refs/remotes/origin/Development/TOTS': cannot lock ref 'refs/remotes/origin/Development/TOTS': 'refs/remotes/origin/Development' exists; cannot create 'refs/remotes/origin/Development/TOTS'

Then I hastily/unwisely tried the same push in the SourceTree GUI. There was no apparent error using this method.

The owners of the "Development" branch now say they get an error when they attempt to pull from it.

But I can still see their "Development" branch in the remote repo (AWS codecommit console) and also in another local repo (that is a day older). The code in "Development" looks pretty old. So wondering is there a chance I've deleted part of its recent history by my push of "Development/TOTS"?

If I delete my "Development/TOTS" branch, will their Development branch go back to how it was? (i.e. no pull errors).

I looked at Using the slash character in Git branch name but the fact that the "Development" branch still exists in the remote seems at odds with the advice.

Thanks.

AJH_2099
  • 13
  • 3

1 Answers1

0

So wondering is there a chance I've deleted part of its recent history by my push of "Development/TOTS"?

No. And even if you had, that code would still be present in the remote repo reflog.

In the AWS codecommit console:

  • check what branches are there with git branch.
  • check the reflog as well, to see the latest Development branch commit.
  • try and delete that Development/TOTS branch (on the remote server side) if it does exists with git branch -d Development/TOTS
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250