LoginSignup
2
1

More than 3 years have passed since last update.

【GitHub】GitHubの使い方(自分用メモ)

Last updated at Posted at 2020-12-02

はじめに

初投稿です。
Qiitaの書き方の練習も兼ねて、GitHubの使い方のチートシートを書いています。
時々更新したりするかもしれません。

ファイル操作系

ディレクトリ(フォルダ)の作成

mkdir sample

ファイルの作成

touch sample

ファイル移動

cd sample

ブランチ

現在の状態を確認する

git branch

チェックアウトする

git checkout -b sample

addとcommit

変更のあったファイルをローカルリポジトリに加える

git add sample

差分を確認する

git diff HEAD

コミット

git commit -m "ここにコメント"

ログを確認
コミットの履歴を確認出来る。
qで終了

git log -p

プッシュ

プッシュする

git push origin sample(ブランチの名前)

プル

リモートリポジトリの変更点をローカルリポジトリに取り組む

プルする

git pull

ブランチの削除

リモートリポジトリのブランチの削除

git push -- delete origin sample

ローカルリポジトリのブランチの削除

git branch -- delete sample

ブランチの確認

git branch -a
2
1
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
2
1