1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-19 12:12:42 +02:00
This commit is contained in:
Jesse Duffield 2018-08-12 11:05:24 +10:00
commit f97a098c6f
2 changed files with 99 additions and 69 deletions

View File

@ -2,13 +2,20 @@
A simple terminal UI for git commands, written in Go with the [gocui](https://github.com/jroimartin/gocui "gocui") library. A simple terminal UI for git commands, written in Go with the [gocui](https://github.com/jroimartin/gocui "gocui") library.
Are YOU tired of typing every git command directly into the terminal, but you're too stubborn to use Sourcetree because you'll never forgive Atlassian for making Jira? This is the app for you! Are YOU tired of typing every git command directly into the terminal, but you're
too stubborn to use Sourcetree because you'll never forgive Atlassian for making
Jira? This is the app for you!
[Tutorial](https://www.youtube.com/watch?v=VDXvbHZYeKY)
![Gif](https://image.ibb.co/mmeXho/optimisedgif.gif) ![Gif](https://image.ibb.co/mmeXho/optimisedgif.gif)
[Twitch Stream](https://www.twitch.tv/jesseduffield) * [Installation](https://github.com/jesseduffield/lazygit#installation)
* [Usage](https://github.com/jesseduffield/lazygit#usage),
[Keybindings](https://github.com/jesseduffield/lazygit/blob/master/docs/Keybindings.md)
* [Cool Features](https://github.com/jesseduffield/lazygit#cool-features)
* [Contributing](https://github.com/jesseduffield/lazygit#contributing)
* [Video Tutorial](https://www.youtube.com/watch?v=VDXvbHZYeKY)
* [Twitch Stream](https://www.twitch.tv/jesseduffield)
## Installation ## Installation
@ -19,7 +26,7 @@ brew install lazygit
``` ```
### Ubuntu ### Ubuntu
Packages for Ubuntu 16.04, 18.04 and 18.10 are available via Launchpad PPA. Packages for Ubuntu 16.04, 18.04 and 18.10 are available via [Launchpad PPA](https://launchpad.net/~lazygit-team).
They are built daily, straight from master branch. They are built daily, straight from master branch.
@ -29,22 +36,29 @@ sudo apt-get update
sudo apt-get install lazygit sudo apt-get install lazygit
``` ```
### Void Linux
Packages for Void Linux are available in the distro repo
They follow upstream latest releases
```sh
sudo xbps-install -S lazygit
```
### Arch Linux ### Arch Linux
Packages for Arch Linux are available via AUR (Arch User Repository). Packages for Arch Linux are available via AUR (Arch User Repository).
There are two packages. The stable one which is built with the latest release and the git version which builds from the most recent commit. There are two packages. The stable one which is built with the latest release
and the git version which builds from the most recent commit.
Stable: * Stable: https://aur.archlinux.org/packages/lazygit/
https://aur.archlinux.org/packages/lazygit/ * Development: https://aur.archlinux.org/packages/lazygit-git/
Development:
https://aur.archlinux.org/packages/lazygit-git/
Instruction of how to install AUR content can be found here: Instruction of how to install AUR content can be found here:
https://wiki.archlinux.org/index.php/Arch_User_Repository https://wiki.archlinux.org/index.php/Arch_User_Repository
### Binary Release (Windows/Linux/OSX) ### Binary Release (Windows/Linux/OSX)
You can download a binary release [here](https://github.com/jesseduffield/lazygit/releases) You can download a binary release [here](https://github.com/jesseduffield/lazygit/releases).
### Go ### Go
```sh ```sh
@ -52,23 +66,27 @@ go get github.com/jesseduffield/lazygit
``` ```
Please note: Please note:
If you get an error claiming that lazygit cannot be found or is not defined, you may need to add `~/go/bin` to your $PATH (MacOS/Linux), or `%HOME%\go\bin` (Windows). Not to be mistaked for `C:\Go\bin` (which is for Go's own binaries, not apps like Lazygit) If you get an error claiming that lazygit cannot be found or is not defined, you
may need to add `~/go/bin` to your $PATH (MacOS/Linux), or `%HOME%\go\bin`
(Windows). Not to be mistaked for `C:\Go\bin` (which is for Go's own binaries,
not apps like Lazygit).
## Usage ## Usage
Call `lazygit` in your terminal inside a git repository. Call `lazygit` in your terminal inside a git repository. If you want, you can
If you want, you can also add an alias for this with `echo "alias lg='lazygit'" >> ~/.zshrc` (or whichever rc file you're using). also add an alias for this with `echo "alias lg='lazygit'" >> ~/.zshrc` (or
Basic tutorial [Here](https://www.youtube.com/watch?v=VDXvbHZYeKY) whichever rc file you're using).
[Keybindings](https://github.com/jesseduffield/lazygit/blob/master/docs/Keybindings.md) * Basic video tutorial [here](https://www.youtube.com/watch?v=VDXvbHZYeKY).
* List of keybindings
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/Keybindings.md).
## Cool features ## Cool features
- Adding files easily * Adding files easily
- Resolving merge conflicts * Resolving merge conflicts
- Easily check out recent branches * Easily check out recent branches
- Scroll through logs/diffs of branches/commits/stash * Scroll through logs/diffs of branches/commits/stash
- Quick pushing/pulling * Quick pushing/pulling
- Squash down and rename commits * Squash down and rename commits
### Resolving merge conflicts ### Resolving merge conflicts
![Gif](https://image.ibb.co/iyxUTT/shortermerging.gif) ![Gif](https://image.ibb.co/iyxUTT/shortermerging.gif)
@ -89,7 +107,12 @@ Basic tutorial [Here](https://www.youtube.com/watch?v=VDXvbHZYeKY)
We love your input! Please check out the [contributing guide](CONTRIBUTING.md). We love your input! Please check out the [contributing guide](CONTRIBUTING.md).
## Work in progress ## Work in progress
This is still a work in progress so there's still bugs to iron out and as this is my first project in Go the code could no doubt use an increase in quality, but I'll be improving on it whenever I find the time. If you have any feedback feel free to [raise an issue](https://github.com/jesseduffield/lazygit/issues)/[submit a PR](https://github.com/jesseduffield/lazygit/pulls). This is still a work in progress so there's still bugs to iron out and as this
is my first project in Go the code could no doubt use an increase in quality,
but I'll be improving on it whenever I find the time. If you have any feedback
feel free to [raise an issue](https://github.com/jesseduffield/lazygit/issues)/[submit a PR](https://github.com/jesseduffield/lazygit/pulls).
## Social ## Social
If you want to see what I (Jesse) am up to in terms of development, follow me on [twitter](https://twitter.com/DuffieldJesse) or watch me program on [twitch](https://www.twitch.tv/jesseduffield) If you want to see what I (Jesse) am up to in terms of development, follow me on
[twitter](https://twitter.com/DuffieldJesse) or watch me program on
[twitch](https://www.twitch.tv/jesseduffield).

View File

@ -1,59 +1,66 @@
# Keybindings: # Keybindings:
## Global: ## Global:
<pre>
← → ↑ ↓/h j k l: navigate <kbd></kbd><kbd></kbd><kbd></kbd><kbd></kbd>/<kbd>h</kbd><kbd>j</kbd><kbd>k</kbd><kbd>l</kbd>: navigate
PgUp/PgDn: scroll diff panel (use fn+up/down on osx) <kbd>PgUp</kbd>/<kbd>PgDn</kbd>: scroll diff panel (use <kbd>fn</kbd>+<kbd>up</kbd>/<kbd>fn</kbd>+<kbd>down</kbd> on osx)
q: quit <kbd>q</kbd>: quit
p: pull <kbd>p</kbd>: pull
shift+P: push <kbd>shift</kbd>+<kbd>P</kbd>: push
</pre>
## Files Panel: ## Files Panel:
<pre>
space: toggle staged <kbd>space</kbd>: toggle staged
c: commit changes <kbd>c</kbd>: commit changes
shift+C: commit using git editor <kbd>shift</kbd>+<kbd>C</kbd>: commit using git editor
shift+S: stash files <kbd>shift</kbd>+<kbd>S</kbd>: stash files
t: add patched (i.e. pick chunks of a file to add) <kbd>t</kbd>: add patched (i.e. pick chunks of a file to add)
o: open <kbd>o</kbd>: open
e: edit <kbd>e</kbd>: edit
s: open in sublime (requires 'subl' command) <kbd>s</kbd>: open in sublime (requires 'subl' command)
v: open in vscode (requires 'code' command) <kbd>v</kbd>: open in vscode (requires 'code' command)
i: add to .gitignore <kbd>i</kbd>: add to .gitignore
d: delete if untracked checkout if tracked (aka go away) <kbd>d</kbd>: delete if untracked checkout if tracked (aka go away)
shift+R: refresh files <kbd>shift</kbd>+<kbd>R</kbd>: refresh files
</pre>
## Branches Panel: ## Branches Panel:
<pre>
space: checkout branch <kbd>space</kbd>: checkout branch
f: force checkout branch <kbd>f</kbd>: force checkout branch
m: merge into currently checked out branch <kbd>m</kbd>: merge into currently checked out branch
c: checkout by name <kbd>c</kbd>: checkout by name
n: new branch <kbd>n</kbd>: new branch
d: delete branch <kbd>d</kbd>: delete branch
</pre>
## Commits Panel: ## Commits Panel:
<pre>
s: squash down (only available for topmost commit) <kbd>s</kbd>: squash down (only available for topmost commit)
r: rename commit <kbd>r</kbd>: rename commit
g: reset to this commit <kbd>g</kbd>: reset to this commit
</pre>
## Stash Panel: ## Stash Panel:
<pre>
space: apply <kbd>space</kbd>: apply
g: pop <kbd>g</kbd>: pop
d: drop <kbd>d</kbd>: drop
</pre>
## Popup Panel: ## Popup Panel:
<pre>
esc: close/cancel <kbd>esc</kbd>: close/cancel
enter: confirm <kbd>enter</kbd>: confirm
tab: enter newline (if editing) <kbd>tab</kbd>: enter newline (if editing)
</pre>
## Resolving Merge Conflicts (Diff Panel): ## Resolving Merge Conflicts (Diff Panel):
<pre>
← →/h l: navigate conflicts <kbd></kbd><kbd></kbd>/<kbd>h</kbd><kbd>l</kbd>: navigate conflicts
↑ ↓/ k j: select hunk <kbd></kbd><kbd></kbd>/<kbd>k</kbd><kbd>j</kbd>: select hunk
space: pick hunk <kbd>space</kbd>: pick hunk
b: pick both hunks <kbd>b</kbd>: pick both hunks
z: undo (only available while still inside diff panel) <kbd>z</kbd>: undo (only available while still inside diff panel)
</pre>