В моей master
ветке у меня есть много файлов, которые мне не нужны:
good_file1
good_file2
bad_file1
bad_file2
good_file3
В моей temp
ветке у меня есть только хорошие файлы:
good_file1
good_fil2
good_file3
Я хочу, чтобы ветвь master
была точно такой же, как ветвь temp
.
Что я делаю:
git checkout master
git reset --hard new15
git push origin master
И я получаю
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ''
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Но теперь, когда я делаю git pull
, я извлекаю bad_files.Также я не могу использовать force
, потому что ветка защищена.Что мне делать?