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 5 years have passed since last update.

Githubにpushしたときmasterがなかった話

Posted at

概要


git init するときに気をつけないと、Githubにpushした際おかしなことになるよ、というお話。

詳細

sam init するときの通常手順

$ mkdir sam_sample && cd sam_sample 
$ sam init --runtime ruby2.5


この1行目のコマンドで一つ目のディレクトリを作り、2行目のコマンドでsam-appのディレクトリを作ります。

ここで、 git init するときに気をつけたいのが、sam-app ディレクトリ内で git init すること!


sam-app のなかでしないと、Githubにプッシュしたときにmasterが表示されないというおかしなことになります。。。
誰も同じことはしないと思いますが、備忘録として!

それでもやっちまったよ!っていう方はこちら↓


① まずはリポジトリの中身を消去します。
② 先ほどgit initしたディレクトリ内で、このコマンドを打ちましょう

$ rm -rf .git

sam-app (または名前を変更していればそのディレクトリ内)に入り、再度git init !

これで、再度Githubにpushしましょう!
今度はうまくいくはずです!

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?