Как добавить файлы в новую ветку уже созданного репозитория?

Мне нужно добавить файлы в ветку созданную мной, не master. Я не понимаю как это сделать. Вот, что я делаю:
git init
git add .
git commit -m "adding files"
git remote add origin https://github.com/s1veme/hotelOrder.git
git push -u origin backend

Получаю:

! [rejected]        backend -> backend (fetch first)
error: failed to push some refs to 'https://github.com/s1veme/hotelOrder.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


Как мне добавить файлы в ветку backend в моем репозитории?
  • Вопрос задан
  • 1413 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы