LoginSignup
0
0

More than 3 years have passed since last update.

Railsチュートリアル 第1章1.16でのエラー: GitHubをリモートoriginに追加してそのリポジトリにpushする 

Posted at

環境

Windows10
AWS Cloud9

事象

リスト 1.16: GitHubをリモートoriginに追加してそのリポジトリにpushする
git push -u origin mainで下記のエラーがでた。

AWScloud9_console
ubuntu:~/environment/hello_app (master) $ git push -u origin main
error: src refspec main does not match any.
error: failed to push some refs to 'https://github.com/●●●●●/hello_app.git'

試したこと

git push -u origin --allここの記事でレポジトリ作った最初のpushならOKということだったのでとりあえず打ってみた

AWScloud9_console
ubuntu:~/environment/hello_app (master) $ git push -u origin --all
Username for 'https://github.com/●●●●●/hello_app.git': ●●●●●
Password for 'https://●●●●●@github.com/●●●●●/hello_app.git': 
Counting objects: 104, done.
Compressing objects: 100% (86/86), done.
Writing objects: 100% (104/104), 148.90 KiB | 3.24 MiB/s, done.
Total 104 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), done.
To https://github.com/●●●●●/hello_app.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

結果

その結果、Githubリポジトリにもpushされたことを確認できた。
とりあえずこのやり方でOKでした。

0
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
0
0