1
0

GitHub記法 チートシート

Last updated at Posted at 2024-01-26

リポジトリ

作成

  1. [New Repository]をクリックし、新しいリポジトリを作成。
    image.png
    image.png

  2. 入力

[Repository name]
リポジトリ名
[Description]
概要
[Public or Private]
リポジトリ参加者だけに見せたいときはPrivate
[Create repository]で新規作成完了

image.png

クローン

git clone (Gitからコピーしたテキスト)

コミット

git add .
git commit -m "n回目のコミットです。"

タグ

git tag 【タグ】

プッシュ

'' Mainをプッシュ
git push origin

'' developをプッシュ
git push origin develop

'' タグをプッシュ
git push origin【タグ】

ブランチ

'' 現在のブランチ確認
git branch

'' ブランチを作成し切り替え
git checkout -b 【新規】

'' リモートブランチを一覧表示
git branch -r

'' ローカルを含んだ全てのブランチ表示
git branch -a

'' ブランチの変更
git checkout 【ブランチ名】

コミットを削除

'' コミットを削除(Windows)
git reset --soft "HEAD^"
git reset HEAD

マージ

'' 【develop】を【main】にマージするとき
git checkout 【main】
git merge 【develop】
git push origin 【main】

プルリクエスト

  1. GitHubを確認する。
    image.png
     
  2. [Create pull request]でプルリクエストを作成
    image.png
     
  3. [Files changed]で差異を確認しレビューを行う。
    image.png
     
  4. レビュー・指摘事項修正が完了すればMainにマージする。
    image.png
1
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
1
0