Skip to content

Instantly share code, notes, and snippets.

@s3rgeym
Created April 16, 2019 10:40
Show Gist options
  • Save s3rgeym/0342b91da15f969cb992ba344830cbf2 to your computer and use it in GitHub Desktop.
Save s3rgeym/0342b91da15f969cb992ba344830cbf2 to your computer and use it in GitHub Desktop.
GIT

Тут все про решениеи проблем с GIT

@s3rgeym
Copy link
Author

s3rgeym commented Apr 16, 2019

Проблема:

Делаем git reset --hard <branch>, коммитим изменения, а потом не можем сделать push:

$ git push -f origin develop
Counting objects: 15, done.Delta compression using up to 8 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (15/15), 1.83 KiB | 1.83 MiB/s, done.
Total 15 (delta 13), reused 0 (delta 0)
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
To gitlab.i-free.com:ibs_dev/filterAdminWebApp.git
 ! [remote rejected] develop -> develop (pre-receive hook declined)
error: failed to push some refs to '[email protected]:ibs_dev/filterAdminWebApp.git'

Решение:

Решено: GitLab: You are not allowed to force push code to a protected branch on this project.
При попытки выполнить команду git push origin master --force

Получаем сообщение: remote: GitLab: You are not allowed to force push code to a protected branch on this project.

Всё очень просто. В GitLab нужно зайти в настройки проекта ⚙️ а именно в пункт protected branches и убрать protected у интересующей вас ветки

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment