404 Error When Accessing Recreated Branch in GitLab
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Description of the bug:
After creating, updating, and merging a branch into the main branch, we then deleted the branch. However, an additional error was found. We attempted to fix the issue by recreating the deleted branch locally and pushing the changes to GitLab. This resulted in the following problems:
- The branch appeared in GitLab, but when we tried to access it, we received a 404 error.
- Local merging was successful, but when we tried to push the changes to the remote repository, we encountered a rejection error.
Error message when attempting to push:
git push origin HEAD
To gitlab.com:kartochka-clients/Kvant.git
! [rejected] HEAD -> main (fetch first)
error: failed to push some refs to 'gitlab.com:kartochka-clients/Kvant.git'
hint: Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. If you want to integrate the remote changes, use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
This error indicates that the remote repository contains changes that are not present in the local version.
Edited by 🤖 GitLab Bot 🤖