Chapter 4. Edit & Commit

How to Edit and Commit using Git Commands

Once you launch a project, you can start to write and edit your code. You can save several versions of code in your Local Repository by committing the codes. In this chapter, we’ll explain key Git commands used in the cycle of editing and saving code (creating version histories).

The following lessons are covered in this chapter.

Lessons in this chapter

  1. Git Regular Workflow – Edit & Commit
  2. Edit and Commit Overview (1)
  3. Add Files to Staging Area – git add
  4. Commit Files – git commit
  5. HEAD and INDEX
  6. Check Status of Working Tree and Staging Area – git status
  7. Check Commit Histories – git log
  8. Check Differences – git diff
  9. Restore Files to Working Tree – git restore
  10. Undo Changes – git reset
  11. Delete Files – git rm
  12. Edit and Commit Overview (2)