Update tig

This commit is contained in:
Rico Sta. Cruz 2017-08-30 00:57:42 +08:00
parent 9fb0bed286
commit 0490d53661
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
2 changed files with 65 additions and 23 deletions

View File

@ -4,6 +4,7 @@ category: Elixir
layout: 2017/sheet layout: 2017/sheet
tags: [New] tags: [New]
updated: 201708 updated: 201708
weight: -10
--- ---
## Reference ## Reference

87
tig.md
View File

@ -1,45 +1,86 @@
--- ---
title: Tig title: Tig
category: Git category: Git
layout: 2017/sheet
updated: 201708.29
weight: -3
--- ---
### Installing ### Installing
$ brew install tig --HEAD ```bash
$ apt-get install tig # MacOS + Homebrew
$ brew install tig --HEAD
```
```bash
# Ubuntu
$ sudo apt install tig
```
### Invocation ### Invocation
tig | Command | Description |
| --- | --- |
| `tig` | |
| --- | --- |
| `tig status` | Status |
| `tig blame FILE` | Blame |
| --- | --- |
| `tig master` | Show a branch |
| `tig test..master` | Show difference between two branches |
| `tig FILE` | Show history of file |
| `tig v0.0.3:README` | Show contents of file in a specific revision |
tig status You can substitute `git log``tig`.
tig blame FILE ## Shortcut keys
tig master # Show a branch {: .-three-column}
tig test..master # Show difference between two branches
tig FILE # Show history of file ### Switching views
tig v0.0.3:README # Show contents of file in a specific revision
| `m` | Main view |
| `s` | Status |
| `t` | Tree (files) |
| `g` | Grep |
| `h` | Help |
{: .-shortcuts}
### All views ### All views
^N # Next on parent view | Shortcut | Description |
^P # Previous on parent view | --- | --- |
| `j` `k` | Up/down |
| `↑J` `↑K` | Next/previous |
| --- | --- |
| `<` | Back |
| `↑R` | Refresh |
| `q` | Close |
| `↑Q` | Close all |
| --- | --- |
| `^N` | Next on parent view |
| `^P` | Previous on parent view |
{: .-shortcuts}
### `m` - Main view ### `m` - Main view
D # Toggle between date display modes | `↑D` | Toggle date display modes |
A # Toggle between author display modes | `↑A` | Toggle author display modes |
C # Cherry pick a commit | `↑X` | Toggle commit sha |
| `↑C` | Cherry pick a commit |
{: .-shortcuts}
### `S` - Stage view ### `s` - Stage view
u # Stage/unstage file or chunk | `u` | Stage/unstage file or chunk |
! # Revert file or chunk | `!` | Revert file or chunk |
C # Commit | `C` | Commit |
M # Merge | `M` | Merge |
1 # Stage line | `1` | Stage line |
[] # Increase/decrease the diff context | `[` `]` | Increase/decrease the diff context |
{: .-shortcuts}
### `H` - Branch view ### `h` - Branch view
i # Change sort header | `i` | Change sort header |
{: .-shortcuts}