0
我在GIT相当新的,我有以下疑问正确使用git的差异的--staged应该比较临时区域内容与上次提交。关于如何正确比较暂存区域内容和使用GIT的上次提交有些疑问?
所以我获得此输出:
$ 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) {
[email protected] MINGW64 ~/Documents/WS_vari/version-control/asteroids ((3884eab
...))
那么究竟意味着这个输出?我认为,这意味着,在临时区域我加这两条线:
1)
+ this.delayBeforeBullet = 10; // added to fix the bug !!!
2)
+ //if (this.delayBeforeBullet = 10) {
,我不会在有上次提交。
它是我的推理是否正确?
是的,你的理解是正确的 – Leon