0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

railsチュートリアル 1章の躓き

Posted at

##1.4.4 README.mdを編集時に
ブランチ、編集、コミット

README.md
# Ruby on Rails Tutorial

## "hello, world!"

This is the first application for the
[*Ruby on Rails Tutorial*](https://railstutorial.jp/)
by [Michael Hartl](https://www.michaelhartl.com/). Hello, world!

上記を編集後コミット

$ git commit -a -m "Improve the README file"

その後エラー発生

$ git checkout master
error: pathspec 'master' did not match any file(s) known to git

###原因
そもそもブランチ名が違うことに気づく

$ git branch
  main ← master
* modify-README

###対処

自分が編集しているブランチ名がそもそも一致していなかったので、masterからmainに変え実行したら解決。
問題なくpushすることができたが、ケアレスミスにも程がある。

$ git checkout main ←← 
Switched to branch 'master'
$ git merge modify-README

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?