LoginSignup
1
0

More than 3 years have passed since last update.

GitHubコマンドメモ

Posted at

はじめに

【GitHub超初心者入門】この前初めてGitHubを使い始めたエンジニア見習いが書くGitHubの使い方と実践~とりあえず一緒に動かしてみようぜ!~

上記の記事を読み終わって「さあやるぞ!」となっても,次の日には忘れると思うのでメモ
自分の言葉で説明するから覚えると思う

読み返せってコメントはなしで

初回のみ

新規作成(コミット)

  1. ここからリポジトリ作成
  2. ローカルディレクトリ作成
  3. ローカルディレクトリ上で git init
  4. ファイル作成(test.cなど)
  5. ファイルをローカルディレクトリに登録(コミット)するために git add test.c
  6. そしてコミット git commit -m "コメント"
  7. ローカルディレクトリに登録された

git add test.cgitcommit -m "コメント" はセット?

新規作成(プッシュ)

  1. 最初の儀式 git remote add origin https://github.com/あなたのUSER_ID/リポジトリ名.git > originalがブランチのデフォルト名になる(変更可能)
  2. GitHub上に載せる(プッシュ) git push origin master

実用

ファイルを更新したら

少しの編集(ローカル上に)

  • コミット
  • git add test.c
  • git commit -m "変更してみたよ"

大きな変更があった場合(GitHub上に)

  • プッシュ
  • git push origin master

テストする場合(元のファイルと枝分かれ)

  • ブランチ
  • 枝を作成 git branch testbranch
  • プランチ確認 git branch
  • ブランチ移動 git checkout testbranch
  • ブランチ確認 git branch
1
0
4

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