LoginSignup
0
1

More than 1 year has passed since last update.

Git command

Last updated at Posted at 2021-08-17

機能ごとに新しくブランチ作成する

git checkout develop(:統合ブランチ)
git checkout -b 新規ブランチ名  #ブランチを新規作成、そのまま切り替える

「完璧な完成品」をgit hubにアップする

コミットメッセージ: Start Finish Add Update Remove Fix

git status
git add *
git commit -m "メッセージ"
git push origin (統合させたい/挙げたいブランチ)
→→プルリク作る

プルリク時、compareing changesで base:develop 統合ブランチ選択

スクリーンショット 2021-08-17 17.00.20.png

プルリク承認後に メンバー・本人がローカルに落とし込む

git checkout develop(:統合ブランチ)
git branch
git pull origin develop(:統合ブランチ)

コンフリクト修正/プルリク承認後 メンバー・本人がローカルに落とし込む

git checkout develop(:統合ブランチ)
git branch
git pull origin develop(:統合ブランチ)
git checkout 自分の作業ブランチ
git merge origin/develop(:統合ブランチ)
git push origin 自分の作業ブランチ

変更履歴を残す準備 (git add)

$ git add *   # 変更があったファイルをすべて索引に追加
$ git add [file] # file名のみ
$ git add -A # git add . + git add -u = 新規作成/編集/削除したファイルをaddする
$ git add -p # 対話モードになり、コード単位でadd指定ができる、addしたいならy(yes),したくないならn(no),コードの塊を分割したいならs(split)でEnterを押していく

$ git add . # すべてのファイル・ディレクトリ
$ git add *.css # すべてのCSSファイル
$ git add -n # 追加されるファイルを調べる
$ git add -u # 変更されたファイルを追加する
$ git rm --cached # addしてしまったファイルを除外(要確認)

変更履歴を保存する (git commit)

$ git commit 
$ git commit -m "Initial commit 1" # メッセージを加える場合
$ git commit --allow-empty -m "empty commit" # 空コミット

$ git commit -a # 変更のあったファイルすべて
$ git

自分のブランチ確認

git branch

ブランチ移動

git checkout 行きたいブランチ名

0
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
0
1