LoginSignup
0
0

More than 1 year has passed since last update.

自分が何を変えたのかがわかる

Posted at

自分が何を変えたかを見る

HEAD、ステージ、作業ツリーの差を表示する

git diff
git diff --staged
git diff HEAD

git diff

作業ツリーとステージの差を出力する。

**************@mbp training % git diff
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index aa9c133..2da7628 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,9 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="************" name="変更" comment="" />
+    <list default="true" id="************" name="変更" comment="">
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+    </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -157,6 +159,9 @@
       <workItem from="1652682099833" duration="65000" />
       <workItem from="1652936559531" duration="238000" />
       <workItem from="1653011747564" duration="76000" />
+      <workItem from="1654566045827" duration="849000" />
+      <workItem from="1654582160922" duration="634000" />
+      <workItem from="1654585766258" duration="75000" />
     </task>
     <servers />
   </component>
diff --git a/hello.txt b/hello.txt
index 10ddd6d..dd2db19 100644
--- a/hello.txt
+++ b/hello.txt
@@ -1 +1 @@
-Hello!
+Hello!!

思ったこと

どれだけのファイルをステージングしていないかが分かる。
+は新たに追加されたことを表している。

git diff --staged

ステージとHEADの差を表示する。

***********@mbp training % git diff --staged
***********@mbp training %

何もステージングされていないから差が発生しない。

思ったこと

コミットしていないかが分かる。

git diff HEAD

作業ツリーとHEADの差を表示する。

***********:@mbp training % git diff HEAD
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index aa9c133..2da7628 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,9 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="************************" name="変更" comment="" />
+    <list default="true" id="************************" name="変更" comment="">
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+    </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -157,6 +159,9 @@
       <workItem from="1652682099833" duration="65000" />
       <workItem from="1652936559531" duration="238000" />
       <workItem from="1653011747564" duration="76000" />
+      <workItem from="1654566045827" duration="849000" />
+      <workItem from="1654582160922" duration="634000" />
+      <workItem from="1654585766258" duration="75000" />
     </task>
     <servers />
   </component>
diff --git a/hello.txt b/hello.txt
index 10ddd6d..5cd4d80 100644
--- a/hello.txt
+++ b/hello.txt
@@ -1 +1,3 @@
 Hello!
+I am a student.
+

気づき

これらからわかったことはステージングはしているけどコミットはされていないことがわかる。

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