// TODO: 概念図
git add FILE で次のコミットにFILEの差分を含める (ステージ)
git add FILE
git reset で次のコミットに含める差分をクリアする (アンステージ)
git reset
git reset FILE で次のコミットからFILEの差分を除外する (アンステージ)
git reset FILE
:computer: index.htmlarrow-up-right の内容に変更を加えた。
index.html
:white_check_mark: index.2.html を index.html にコピー(上書き)
index.2.html
:computer: style.cssarrow-up-right の内容に変更を加えた。
style.css
:white_check_mark: style.2.html を style.css にコピー(上書き)
style.2.html
:octocat: index.htmlの変更をステージせよ
:octocat: index.htmlの変更をアンステージせよ
:octocat: index.htmlとstyle.cssの変更をステージせよ
:octocat: index.htmlとstyle.cssの変更をアンステージせよ
git add index.html でindex.htmlをステージ
git add index.html
git reset index.htmlでindex.htmlのみをアンステージ
git reset index.html
git add *でindex.htmlとstyle.cssをステージ (git add index.html style.css`でも同じ)
で
と
をステージ (
git resetでindex.htmlとstyle.cssをアンステージ (git reset index.html style.css`でも同じ)
をアンステージ (
git addコマンドは、、次のコミットに変更差分を含めるようgitに指示するためのコマンドです。 詳しくはadd & commitをご覧ください。
git add
しかし誤ってgit addをした場合に、操作を取り消す(= 次のコミットに含める差分をクリアする)必要が生じる場合があります。 そのためのコマンドがgit resetです。
Last updated 7 years ago