LoginSignup
0
0

More than 1 year has passed since last update.

GitHub CLIを使ってみる2

Last updated at Posted at 2022-02-26

開発環境にローカルのリポジトリを作ります。

git init

次に

git add .

git addコマンドでコミットしたいファイルを「インデックス」あるいは「ステージングエリア」と呼ばれる領域に追加します。.は全てのファイルです。

git status

で確認してみましょう。

コミットしていきます。

git commit -m "First Coomit"

コミットできたら、ghコマンドでリモートのリポジトリを作っていきます。

gh repo create
? Repository name {リポジトリ名}
? Repository description {自由に書いてみて}
? Visibility  [Use arrows to move, type to filter]
> Public
  Private
  Internal

? Repository nameリポジトリの名前を聞かれます。そのままでいいならEnter。
? Repository descriptionリポジトリの説明。自由に書いてみてください。
? Visibility公開するかしないか聞いています。Publicにします。後で変更可能です。

? This will add an "origin" git remote to your local repository. Continue?

originという名前のローカルリポジトリに追加されます。yを推します。

まだ完成ではありません。ここで反映していきます。

git checkout -b develop

その後にプッシュしていきます。

git push -u origin develop

ここでちゃんと反映されているか確認してみましょう。

gh repo view --web

ブラウザが立ち上がり、作成したリポジトリが出ます。

これにて完成です!

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