As of a few hours ago, we are not able to push to our remote repository.
We now have two branches which if we try to push to with no local changes, we get the error:
Enumerating objects: 12, done. Counting objects: 100% (12/12), done. Delta compression using up to 24 threads Compressing objects: 100% (2/2), done. Writing objects: 100% (7/7), 1.19 KiB | 1.19 MiB/s, done. Total 7 (delta 5), reused 7 (delta 5), pack-reused 0 remote: Resolving deltas: 100% (5/5), completed with 5 local objects. To github.com:<my organisation>/<my private repository>.git ! [remote rejected] master -> master (cannot lock ref 'refs/heads/master': is at XXXX.... but expected YYYY.... error: failed to push some refs to 'github.com:<my organisation>/<my private repository>.git'
XXXX is the last commit and
YYYY is an earlier commit from yesterday.
Making a source code change directly on Github and running
git pull works and gets the change, but doing a
git push after that results in the same error.
If we attempt to create a new branch off another old branch, with no changes and just push to remote with
git push -u origin test-branch, and then immediately run just
git push, we get the following error:
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 To github.com:<my organisation>/<my private repository>.git ! [remote rejected] test-branch -> test-branch (cannot lock ref 'refs/heads/test-branch': reference already exists)
Cloning to a new local repository does not help, so we suspect remote references got corrupt somehow.
This is rather urgent and your help would be greatly appreciated.