Skip to content

Commit 25bf81f

Browse files
authored
docs: git add -A の記載を安全化 (#206)
* docs: git add -A の記載を安全化 * docs: git add -u の注意点を追記
1 parent 202501e commit 25bf81f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • manuscript/appendix-git-commands-reference

manuscript/appendix-git-commands-reference/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ git add <ファイル名>
5757
# すべての変更ファイルを追加
5858
git add .
5959

60-
# すべての変更(削除含む)を追加
61-
git add -A
60+
# 追跡中ファイルの変更(削除含む)のみを追加(新規/リネーム後のファイルは含まれない)
61+
git add -u
62+
# 新規/リネーム後のファイルは別途 git add <ファイル名> などで追加する
6263

6364
# インタラクティブに追加
6465
git add -i
@@ -492,8 +493,8 @@ git fetch && git merge origin/main
492493
# 作業開始前の準備
493494
git pull && git status
494495

495-
# 作業完了後の一連の流れ
496-
git add -A && git commit -m "機能実装完了" && git push
496+
# 作業完了後の一連の流れ(新規/リネームファイルは明示的に追加)
497+
git status && git add -u && git add <新規/リネームファイル...> && git commit -m "機能実装完了" && git push
497498

498499
# ブランチ切り替え前の安全確認
499500
git status && git stash && git switch main

0 commit comments

Comments
 (0)