Source Control
Staging & Committing
Look at a change before you commit it. Stage a whole file, or just the lines you want.
Staging changes
Hover a file in the Changes group and click the + to stage it, or stage everything from the group's own +. Staged files move into Staged Changes, ready to commit.
Review the diff
Click a changed file to open a side-by-side or inline diff against the last committed version. Pick the layout you prefer.
Stage selectively
Stage part of a file by selecting lines in the diff and choosing Stage Selected Ranges. That helps when a file has a real fix and an unrelated formatting change you want in different commits.
Write a commit message
Type in the message box at the top of the Source Control view. Drafts are remembered per branch, so switching away and back does not lose a message you were still writing.
Commit
Press Ctrl+Enter (Cmd+Enter on macOS) or click the checkmark. If nothing is staged, committing stages and commits every tracked change.
Amending a commit
Use the dropdown next to the commit button, or Git: Commit (Amend) from the Command Palette, to fold your staged changes into the previous commit.
Commit message conventions
Gyaanmitra does not force a commit message format. It does help you follow
one. The message box shows a guide for subject-line length, and if Git has
a commit template (commit.template), that template is used automatically.
Discarding changes
Right-click a file in the Changes group and choose Discard Changes to put it back to the last commit. You get a confirmation first. Gyaanmitra's own undo cannot bring that back. Git's reflog is still there at the repository level.