🟣 Git Add-Commit-Push to GitHub
Save progress regularly
Use a VS Code terminal (PowerShell, zsh, or bash) opened in the root project folder.
IMPORTANT: Replace the commit message with a clear description of what you added or changed. Wrap the commit message in double quotes. See: How to Write a Good Commit Message
Save progress frequently.
Some tools may modify files,
so you may need to re-run git add and git commit
to ensure everything is committed before pushing.
git add -A
git commit -m "your message here"
# repeat if changes were made (try the UP ARROW)
git add -A
git commit -m "your message here"
git push -u origin main
The -u option tells Git to remember origin main
as the upstream branch for future commands.
After running the longer push command once,
you can use the shorter version:
git push
If git hooks modified files or blocks the commit
A project may use git hooks
that run automatically when you run git commit.
Case 1. If the hooks modify files (for example, formatting), the commit may stop so you can review the changes. This is common. Just run the commands again as shown above.
git add -A
git commit -m "your message here"
Case 2. If the checks report errors, read the messages in the terminal, fix the issue, and try again.
Case 3. If you cannot resolve the issue after reviewing the messages,
you can bypass checks for that commit using the --no-verify flag.
git commit -m "your message here" --no-verify
Important: --no-verify bypasses local Git hooks for this commit only.
It does not bypass GitHub Actions, CI, or required security checks.
Those checks still run independently when changes are pushed to GitHub.