1
0

More than 3 years have passed since last update.

git push -u origin mainでpushされずerrorになる

Last updated at Posted at 2021-02-19

rails tutorialのversion 6.0の1章でgitの扱い方を学びながら進めていたがgit push -u origin mainをしたら下記のようなエラーに遭遇した

terminal

error: src refspec main does not match any
error: failed to push some refs to '自分のgithubアカウント'

原因

2020/10月からgithubはレポジトリ名をmasterからmainに変更したためmainでpushしてもレポジトリ名が違うためerrorになるとのこと

次のようにgit branchで調べるとその通りだった

% git branch
* master

ので次のようにブランチを変えて解決

% git branch -M main
% git branch
* main

まだまだ初学者なのだと実感させられる

参考になったURL

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0