これおもしろい

らふにかいてこ

リポジトリの初git pushがrejectされる

git init
からの
git remote add origin git@github.com:takattata/notification-word.git
からの
git push origin master
でいつも詰まる

> git push origin master
To github.com:takattata/notification-word.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:takattata/notification-word.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.

git慣れしてない自分には投げ出したくなるエラーですが、「とにかくまずpullをするのです」という意味なのは汲めたので、pullしてみたもののうまくいかず…

結局ググってて見つけたとこのコメントに(どこのページか分からなくなりました…Qiitaだったはず…)、git pull --rebase origin masterというのを見かけたので試してみたところ解決

というのを書いている最中に、pullの仕方を間違えていたのではないかと気づきました
履歴がgit pull master originになってる
これgit pull origin masterではなかろうか

…ま、まあでも--rebaseつけてなかったら多分commitしてたものが消えてしまってたと思うので、怪我の功名とでも思っておきます