$ git push -u origin master
To https://git.xxxx.com/test/xxx.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.xxxx.com/test/xxx.git'
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.
どうや先にpullしないとだめみたいです。$ git pull origin masterでpullをしたら、今度またエラーがおきました。
fatal: refusing to merge unrelated histories
解決方法は、オプション--allow-unrelated-historiesを追加することです。以下で無事に解決できました。
$ git pull origin master --allow-unrelated-histories
From https://git.xxxx.com/test/xxx.git
* branch master -> FETCH_HEAD
Merge made by the 'recursive' strategy.
README.md | 2 ++
1 file changed, 2 insertions(+)
0 件のコメント:
コメントを投稿