सुनिश्चित करें कि आपने कुछ बदलाव किए हैं। अन्यथा, git commit -v
आपको आपके द्वारा पोस्ट की गई एक ब्लॉक दिखाएगा, लेकिन कुछ भी नहीं करेगा। आप git add
के साथ मैन्युअल रूप से परिवर्तन चरणबद्ध कर सकते हैं, या यदि फ़ाइलें पहले से ही संस्करणित हैं, तो आप चरण में git commit -a -v
का उपयोग कर सकते हैं और परिवर्तन कर सकते हैं।
उदाहरण के लिए:
$ echo "more foo" >> foo.txt
$ git commit -v
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: foo.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
परिवर्तन मचान git commit -v
साथ diff पता चलता है:
:: git add foo.txt
:: GIT_EDITOR=cat git commit -v
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: foo.txt
#
diff --git a/foo.txt b/foo.txt
index 257cc56..a521556 100644
--- a/foo.txt
+++ b/foo.txt
@@ -1 +1,2 @@
foo
+more foo
Aborting commit due to empty commit message.
तुम सिर्फ करने के बिना diff को देखने के लिए, git diff
उपयोग करने के लिए, unstaged परिवर्तन देखने के लिए git diff --cached
चाहते हैं अपने काम करने वाले पेड़ में चरणबद्ध और अस्थिर परिवर्तन दोनों को देखने के लिए प्रतिबद्धता के लिए चरणबद्ध परिवर्तन, या git diff HEAD
देखें।
अद्यतन: अपना संपादन दिया गया है, जो आप वास्तव में चाहते हैं git diff
ऊपर डेरिवेटिव हैं। मुझे यकीन नहीं है कि कैसे Aptana स्टूडियो काम करता है। यह ठेठ कमांड लाइन गिट प्रवाह का पालन नहीं कर सकता है। कमांड लाइन पर, आप अपने परिवर्तनों को मंचित करेंगे, और फिर प्रतिबद्ध होंगे। और उपर्युक्त git diff
कमांड वे हैं जो आप उन परिवर्तनों की जांच के लिए उपयोग करेंगे। मैं आमतौर पर उन्हें git unstaged
, git staged
, और git both
के रूप में मेरे ~/.gitconfig
को यह जोड़कर उपनाम:
[alias]
# show difference between working tree and the index
unstaged = diff
# show difference between the HEAD and the index
staged = diff --cached
# show staged and unstaged changes (what would be committed with "git commit -a")
both = diff HEAD
+1 हां। 'गिट diff। htaccess' जो मैं प्राप्त करना चाहता था। धन्यवाद :) – Houman