How to Commit¶
This page walks through the actual mechanics of making a commit — staging changes, writing the message, and pushing it up. For guidance on what to put in the commit message, see Commits.
Commits can be made either through the terminal or through your JetBrains IDE (IntelliJ IDEA / Android Studio). Both are shown below — use whichever you're more comfortable with.
JetBrains IDE (IntelliJ IDEA / Android Studio)¶
1. Open the Commit tool window¶
Find it on the left-hand sidebar (usually labeled Commit), or open it with:
- Windows/Linux:
Ctrl+K - macOS:
Cmd+K
2. Review your changes¶
The Commit window lists every modified, added, and deleted file in your working directory, grouped by changelist. Click any file to see its diff on the right before deciding whether to include it.

3. Select what to include¶
Check the box next to each file you want in this commit. You don't have to commit everything at once — uncheck anything you're not ready to commit yet, and it'll stay pending for a later commit.
4. Write your commit message¶
Type your message in the text box above the file list.
5. Commit, or Commit and Push¶
- Commit — saves the commit locally only. You'll need to push separately later.
- Commit and Push — saves the commit and pushes it to the remote in one step.
Both buttons are at the bottom of the Commit tool window.
Never commit directly to main
We don't have branch protection rules set up (requires a paid plan), so nothing stops you from pushing straight to main.
Always work on a feature branch and go through a PR—even for "tiny" changes.

6. Confirm it pushed¶
Check the Git tool window (bottom toolbar) or run git log in the terminal to confirm your commit landed and pushed successfully.
Terminal¶
1. Check what's changed¶
Before committing, see what files you've modified:
This shows you modified, added, and untracked files. It's good practice to check this before every commit so you know exactly what you're about to include.
2. Review your actual changes (optional but recommended)¶
If you want to see the line-by-line diff of what changed before staging:
3. Stage your files¶
Stage a specific file:
Stage multiple specific files:
Stage everything that's changed:
Tip: Prefer staging specific files over git add . when you have unrelated changes sitting in your working directory — this keeps commits focused on one logical change instead of bundling unrelated edits together.
4. Confirm what's staged¶
Staged files show up in green (ready to commit). Anything still red/unstaged won't be included.
5. Commit¶
Never commit directly to main
We don't have branch protection rules set up (requires a paid plan), so nothing stops you from pushing straight to main.
Always work on a feature branch and go through a PR—even for "tiny" changes.
For a longer, multi-line message (a summary line plus a more detailed body):
Or open your default editor to write a longer message:
6. Push your commit¶
If this is the first push on a new branch, you'll need to set the upstream:
After the first push, plain git push will work for that branch.
Common issues¶
"Everything up-to-date" but you expected changes to push
You likely forgot to git add before committing, or committed on the wrong branch. Run git status and git log --oneline -5 to check.
Push rejected (non-fast-forward)
Someone else pushed to the branch since you last pulled. Run:
to merge in the latest changes, resolve any conflicts if prompted, then push again.
Accidentally staged a file you didn't mean to
This unstages it without discarding your actual changes.