Skip to main content

To stage a file is simply to prepare it finely for a commit. Git, with its index, allows you to commit only certain parts of the changes you've done since the last commit. 

Say you're working on two features - one is finished, and one still needs some work done. You'd like to make a commit and go home (5 o'clock, finally!) but wouldn't like to commit the parts of the second feature, which is not done yet. 

You stage the parts you know belong to the first feature, and commit. Now your commit is your project with the first feature done, while the second is still in work-in-progress in your working directory.

illustration of local operations in a Git repo: between the working directory, the staging area, and the Git directory (repository)

To stage a file is simply to prepare it finely for a commit. Git, with its index allows you to commit only certain parts of the changes you've done since the last commit. Say you're working on two features - one is finished, and one still needs some work done. You'd like to make a commit and go home (5 o'clock, finally!) but wouldn't like to commit the parts of the second feature, which is not done yet. You stage the parts you know belong to the first feature, and commit. Now your commit is your project with the first feature done, while the second is still in work-in-progress in your working directory.

To stage a file is simply to prepare it finely for a commit. Git, with its index, allows you to commit only certain parts of the changes you've done since the last commit. 

Say you're working on two features - one is finished, and one still needs some work done. You'd like to make a commit and go home (5 o'clock, finally!) but wouldn't like to commit the parts of the second feature, which is not done yet. 

You stage the parts you know belong to the first feature, and commit. Now your commit is your project with the first feature done, while the second is still work-in-progress in your working directory.

illustration of local operations in a Git repo: between the working directory, the staging area, and the Git directory (repository)

Source Link
Rook
  • 20k
  • 9
  • 56
  • 96

To stage a file is simply to prepare it finely for a commit. Git, with its index allows you to commit only certain parts of the changes you've done since the last commit. Say you're working on two features - one is finished, and one still needs some work done. You'd like to make a commit and go home (5 o'clock, finally!) but wouldn't like to commit the parts of the second feature, which is not done yet. You stage the parts you know belong to the first feature, and commit. Now your commit is your project with the first feature done, while the second is still in work-in-progress in your working directory.