我是 GIT 的新手,我对 git diff --staged 的正确用法存在以下疑问,应该比较暂存区< / strong>上次提交的内容。
所以我得到了这个输出:
$ git diff --staged
diff --git a/game.js b/game.js
index 49bf5ea..0783175 100644
--- a/game.js
+++ b/game.js
@@ -421,6 +421,7 @@ Ship = function () {
}
if (KEY_STATUS.space) {
if (this.delayBeforeBullet <= 0) {
+ this.delayBeforeBullet = 10;
// added to fix the bug !!!
for (var i = 0; i < this.bullets.length; i++) {
if (!this.bullets[i].visible) {
SFX.laser();
@@ -539,6 +540,7 @@ BigAlien = function () {
this.delayBeforeBullet -= delta;
if (this.delayBeforeBullet <= 0) {
+ //if (this.delayBeforeBullet = 10) {
this.delayBeforeBullet = 22;
for (var i = 0; i < this.bullets.length; i++) {
if (!this.bullets[i].visible) {
Andrea@Andrea-PC MINGW64 ~/Documents/WS_vari/version-control/asteroids ((3884eab
...))
那究竟是什么意思呢?我认为这意味着,在临时区域中我添加了这两行:
1)
+ this.delayBeforeBullet = 10; // added to fix the bug !!!
2)
+ //if (this.delayBeforeBullet = 10) {
我在上次提交时没有。
我的推理是否正确?
答案 0 :(得分:1)
是的,但更准确地说,在暂存区域中,您有一个具有这两个额外行的文件版本。
登台区域包含完整文件,而不仅仅是与其他文件的差异。它还包含其他文件的完整副本;它们与['Response'][0]['B']
提交中的文件版本完全相同,因此HEAD
不会显示它们。