A commit finalizes selected changes as a snapshot in a Git repository and records a message describing what changed. It follows git add, which prepares the files to track. section 2.3.3
Use the basic commit workflow:
- Make changes, review which files should be tracked, and update .gitignore when necessary. section 2.3.3
- Prepare selected files with git add path/to/file/or/folder/. section 2.3.3
- Save the prepared changes with git commit -m "Commit message". section 2.3.6
- Inspect history with git log or examine a particular commit with git show <commit-id>. section 2.3.6
- Push committed changes to a remote repository when they are ready to share or host elsewhere. section 2.3.3 section 2.4.3
Initial project commit
After preparing a Python project, run git commit -m "Initial python project commit". Continue using git add followed by git commit whenever you make related incremental changes. section 2.3.3
git commit -m "Initial python project commit"
Run the initial Python project commit command after adding the files you want Git to track. section 2.3.3




