LazyGit


LazyGit

github: https://github.com/jesseduffield/lazygit

简介: https://github.com/jesseduffield/lazygit/blob/master/README.md

安装

二进制文件

For Windows, Mac OS(10.10+) or Linux, you can download a binary release here.

Homebrew

brew install jesseduffield/lazygit/lazygit

Core:

brew install lazygit

MacPorts

Latest version built from github releases. Tap:

sudo port install lazygit

Ubuntu

sudo add-apt-repository ppa:lazygit-team/release
sudo apt-get update
sudo apt-get install lazygit

Void Linux

sudo xbps-install -S lazygit

Scoop (Windows)

You can install lazygit using scoop. It’s in the extras bucket:

# Add the extras bucket
scoop bucket add extras

# Install lazygit
scoop install lazygit

Arch Linux

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.

Instruction of how to install AUR content can be found here: https://wiki.archlinux.org/index.php/Arch_User_Repository

CentOS 7

Packages for Fedora and CentOS 7 are available via Copr (Cool Other Package Repo).

yum install dnf 
sudo dnf copr enable atim/lazygit -y
sudo dnf install lazygit

Solus Linux

sudo eopkg install lazygit

FreeBSD

pkg install lazygit

Go

go get github.com/jesseduffield/lazygit

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).

Chocolatey (Windows)

You can install lazygit using Chocolatey:

choco install lazygit

Manual

You’ll need to install Go

git clone https://github.com/jesseduffield/lazygit.git
cd lazygit
go install

You can also use go run main.go to compile and run in one go (pun definitely intended)

Usage

Call lazygit in your terminal inside a git repository.

$ lazygit

If you want, you can also add an alias for this with echo "alias lg='lazygit'" >> ~/.zshrc (or whichever rc file you’re using).

Keybindings

You can check out the list of keybindings here.

Changing Directory On Exit

If you change repos in lazygit and want your shell to change directory into that repo on exiting lazygit, add this to your ~/.zshrc (or other rc file):

lg()
{
    export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir

    lazygit "$@"

    if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
            cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
            rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
    fi
}

Then source ~/.zshrc and from now on when you call lg and exit you’ll switch directories to whatever you were in inside lazyigt. To override this behaviour you can exit using shift+Q rather than just q.

安装git高版本

官网: https://git-scm.com/

到2021-02-07为止: git2.30.0 : https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.0.tar.gz

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.0.tar.gz
tar -xzvf git-2.30.0.tar.gz
cd git-2.30.0
./configure
make && make install 

安装go

yum install go 

开始使用

命令: lazygit

添加全部或者取消全部 : a

提交修改: c

覆盖修改: A (提交历史上面只会显示上次的提交请求,,但是文件已经改变了)

用编辑器打开提交信息编辑: C

添加忽略文件 : i

保存现场: s pop操作: g apply操作: 空格 删除: d

拉取: p

上传: P

合并: M

重命名提交信息: R

==回滚1: 选中分支,空格,,再在这个分支的基础上new 一个分支==

==回滚2: 选中分支g ,有三个选项,回车就行==

复制分支 : c

粘贴分支: v

(一个一个编辑) 在commit 面板合并提交: s (这次和上次提交合并为一个提交)

(一起编辑 ) 编辑commit : e 提交: m

提交比较: i

冲突合并:

(保留其中一个): 空格选中保留部分

(两个都想保留): b

ctrl+ f : 查看文件历史的提交


文章作者: anlen123
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 anlen123 !
 上一篇
EasyExcel EasyExcel
EasyExcelhttps://www.yuque.com/easyexcel/doc/easyexcel 实例1 package com.lhq.Main; import com.alibaba.excel.EasyExcel;
2021-02-24 anlen123
下一篇 
对一次redis搭建集群的记录 对一次redis搭建集群的记录
对一次redis搭建集群的记录1. 使用docker 搭建两个redis 节点1.1 创建自定义docker网络docker network create --driver=bridge --subnet=192.168.0.0/16 --
2021-01-26 anlen123
  目录