git commit -m "Message"

Commit all the files that are already tracked by git without adding them to staging area Untracked files will not committed to the repo

git commit --amend -m "New commit message"
git commit -am "Message"

The --amend is an command that is used to fix mistakes that was made in the last commit
This can be used to add new files and changes to the commit message as well

git commit --amend --no-edit

Add new files to the last commit without changing the commit message

Important

  • --amend commands should only be only used in local copy of repo
  • --allow-empty flag can be used to make a commit without any changes

Commit Message

PrefixDescriptionExample
featA new feature.feat: Add user authentication
fixA bug fix.fix: Resolve crash on login
docsDocumentation changes.docs: Update README for installation instructions
styleChanges that do not affect the meaning of the code.style: Format code with black
refactorA code change that neither fixes a bug nor adds a feature.refactor: Simplify user service logic
perfA code change that improves performance.perf: Optimize image loading
testAdding missing tests or correcting existing tests.test: Add unit tests for authentication
choreChanges to the build process or auxiliary tools.chore: Update dependencies
buildChanges that affect the build system or external dependencies.build: Add webpack configuration
ciChanges to CI configuration files and scripts.ci: Update GitHub Actions workflow