Working with changes, staging, and commits

Git is all about taking a snapshot of your code to your repository, as and when you commit your changes. There are three stages/areas where Git tracks the changes as you continue working on your repository:

  • Unmodified: This is the area where the available files have not yet changed since your last commit to your repository. When you change some files and save them, Git will mark them as modified.
  • Modified: These are the files that have been changed after your last commit but not yet staged for your next commit. When you stage these files, Git will move them to the staging area.
  • Staging: This is the area where the changed files have been added for your next commit. When you commit the staged files, they will be marked as unmodified:

Let's learn how to stage changes, commit changes, discard uncommitted changes, and amend messages to an existing commit.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.1.232