ファイル内の4行のコードを更新し、すべてが機能していることを確認してコードをコミットしました。Git diffで間違った変更が表示される
私はgit status
をチェックして、私が作業していたファイルを変更したことをgitが認識していることを確認してください。
しかし、git diff
を実行すると、別のコード行が変更されたことと、の行がに変更されたことが変更されていないと表示されます。
これを修正してgitに変更を正しく認識させるにはどうすればよいですか?
問題の私のコード(コメントでマークされた行を変更):
<cfcomponent displayname="Config" output="false" alias="com.ams.sms.timekeeper.ConfigBean">
<cfproperty name="Config_ID" type="numeric" default="" />
<cfproperty name="School_ID" type="numeric" default="" />
<cfproperty name="Is_Recycled" type="numeric" default="" />
<cfproperty name="Period_Type" type="numeric" default="" />
<cfproperty name="Rounding_Unit" type="numeric" default="" />
<cfproperty name="Grace_Time" type="numeric" default="" />
<cfproperty name="Auto_Create_Periods" type="boolean" default="" />
<cfproperty name="Verification_Method" type="numeric" default="" />
<cfproperty name="Allow_Manual" type="boolean" default="" />
<!---
PROPERTIES
--->
<cfscript>
variables.Config_ID="";
variables.School_ID="";
variables.Is_Recycled=0; // changed
variables.Period_Type=1;
variables.Rounding_Unit=0; //changed
variables.Grace_Time=0; //changed
variables.Auto_Create_Periods=true;
variables.Verification_Method=0; //changed
variables.Allow_Manual=true;
</cfscript>
git diff
は私が持っていないライン1を、更新したことを言って、次のように返し、上の変化を無視しますさらに次の行:
$ git diff
diff --git a/ams/sms/timekeeper/ConfigBean.cfc b/ams/sms/timekeeper/ConfigBean.cfc
index e2db893..9dabfc9 100644
--- a/ams/sms/timekeeper/ConfigBean.cfc
+++ b/ams/sms/timekeeper/ConfigBean.cfc
@@ -1 +1 @@
-<cfcomponent displayname="Config" output="false" alias="com.ams.sms.timekeeper.ConfigBean">^M^M
\ No newline at end of file
+<cfcomponent displayname="Config" output="false" alias="com.ams.sms.timekeeper.ConfigBean">^M^M
\ No newline at end of file
(END)
すでにファイルに 'git add'と呼ばれていますか? – JETM
これは追加の前ですが、addを実行した後もdiffを実行して同じ結果が得られます。 –