くわこのpermission denied.

WEBエンジニアの僕がぶつかった技術的な問題や発見

【git】リモートブランチにpushできない

gitで新しいリモートブランチにpushできない問題

gitで新しいリモートブランチ(hogehoge)を作ってそこにローカルのdevブランチからpushしたいのにpushしようとしたら

git push origin hogehoge

error: src refspec hogehoge does not match any.
error: failed to push some refs to 'http://xxxxxxxxxxx'

みたいなエラー。

何かなと思ったら、git push の正式な使い方は

git push origin dev:hogehoge

のように[push元のブランチ:push先のブランチ]を指定しなければいけなかったのを忘れていた。
ローカルのdevブランチからリモートのdevブランチにpushするときのみ、

git push origin dev

でいける。

うっかりm9(^Д^)