git diff - Some doubts about how correctly compare the staging area content with the last commit using GIT? -


i pretty new in git , have following doubt correct use of git diff --staged should compare staging area content last commit.

so obtain output:

$ 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 fix bug !!!          (var = 0; < 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;        (var = 0; < this.bullets.length; i++) {          if (!this.bullets[i].visible) {  andrea@andrea-pc mingw64 ~/documents/ws_vari/version-control/asteroids ((3884eab ...)) 

so means output? think means that, in staging area have add these 2 lines:

1)

 + this.delaybeforebullet = 10; // added fix bug !!! 

2)

+       //if (this.delaybeforebullet = 10) { 

that don't have in last commit.

is reasoning correct?

yes, it's more accurate in staging-area, have version of file has 2 lines.

the staging-area contains complete files, not differences other files. has complete copies of other files well; they're identical versions of files in head commit, git diff doesn't show them.


Comments

Popular posts from this blog

Combining PHP Registration and Login into one class with multiple functions in one PHP file -

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -