Git in Skink: diff, stage hunks, blame, commit, branches
Skink shows git changes next to the line numbers and lets you stage, revert, commit and switch branches without leaving the editor.
Press Alt+Shift+C for the git panel, Alt+Shift+D to peek at the change under the cursor, and :diff to compare the file side by side.
Gutter marks
Section titled “Gutter marks”Next to the line numbers, compared with the index:
- Green bar: added lines
- Blue bar: modified lines
- Red mark: deleted lines
- Dotted bar: a change that is already staged
The scrollbar (the editor’s last column) shows the same marks for the whole file.
Turn them off with "gitgutter": false.
Working with hunks
Section titled “Working with hunks”| Key | Command | Does |
|---|---|---|
| Alt+Shift+N | :nexthunk |
Next change |
| Alt+Shift+P | :prevhunk |
Previous change |
| Alt+Shift+D | :hunk |
Peek at the change: s stage, u unstage, r revert, Esc |
| Alt+Shift+S | :stagehunk |
Stage the change at the cursor |
:unstagehunk |
Unstage it | |
:reverthunk |
Put the index version back |
Clicking a gutter mark opens the same peek. Reverting is a normal edit, so Ctrl+Z undoes it.
- Inline blame: the faded author, date and summary at the end of the cursor line. On by default.
- Alt+Shift+B (
:inlineblame) toggles it. "inlineblame": falseturns it off for good.
- Alt+Shift+B (
:blame: the whole file’s blame in a tab. Enter on a line shows that commit.
| Command | Shows |
|---|---|
:diff |
This file side by side against the index |
:diff HEAD |
This file against the last commit |
:diff all |
git diff of the whole tree, in a tab |
The git panel
Section titled “The git panel”Alt+Shift+C (or :gitstatus, :status) opens the panel. In it:
| Key | Does |
|---|---|
| Enter | Open the file |
| s / u | Stage / unstage the file |
| S / U | Stage / unstage all |
| d | Discard changes (asks first; untracked files go to the trash) |
| c | Commit |
| C | Amend |
| b | Branches |
| z / Z | Stash / list stashes |
| g | Refresh |
| P / p / f | Push / pull / fetch |
Push, pull and fetch run in a terminal tab, so git asks for passwords, passphrases and keys itself.
Skink never handles your credentials.
Committing
Section titled “Committing”:commit MESSAGEcommits with that message.:commitalone opens a message tab. Write the message and save it (Ctrl+S) to commit. Closing the tab cancels.- In the message tab,
:amendtoggles amending the last commit and:signofftoggles a Signed-off-by line.
To use Skink for git commit run from a shell too, see Use Skink as your $EDITOR.
:stage [PATH] and :unstage [PATH] work on the current file or PATH.
Branches and stash
Section titled “Branches and stash”| Command | Does |
|---|---|
:branches |
List local branches. Enter switches, D deletes (asks first) |
:branch NAME |
Create NAME and switch to it |
:switch NAME (:checkout) |
Switch to a branch |
:stash [MESSAGE] |
Stash the current changes |
:stashes |
List stashes. Enter applies, p pops, D drops |
:push, :pull, :fetch [ARGS] |
In a terminal tab |
:git ARGS |
Run any git command, output in a tab |
Merge conflicts
Section titled “Merge conflicts”| Command | Does |
|---|---|
:conflicts |
Open every conflicted file at its first marker |
:nextconflict / :prevconflict |
Move between conflict blocks |
:ours / :theirs / :both |
Resolve the block under the cursor |
Conflict blocks are tinted: ours green, theirs blue.
The first line of each block shows “Accept ours | theirs | both”, and you can click one. Every resolution is undoable.
In the file tree
Section titled “In the file tree”File names are coloured by status:
- modified: yellow
- added: green
- untracked: teal
- conflicted: red
- ignored: grey
A folder takes the colour of its most serious file.
Requirements
Section titled “Requirements”Skink runs your installed git for these features, so it needs git on your PATH.