lazygit教程一

2,409 阅读1分钟
  • 终端工具lazygit,适合键盘党,vim党,让你在指尖上飞舞

安装

brew install lazygit

设置别名

echo alias lg="lazygit" >> ~/.zshrc

detla配置

  • ~/.gitconfig
[core]
    pager = delta --dark
[interactive]
    diffFilter = delta --dark --color-only

  • ~/Library/Application\ Support/lazygit/config.yml
git:
  pull:
  mode: 'auto'
  overrideGpg: true
  paging:
  colorArg: always
  pager: delta --dark --paging=never

image.png image.png

面板

  • 通过数字1~5进行切换
  • 也可用方向箭
  • vim用户使用hjkl

Snipaste_2022-12-12_17-07-52.png

操作实战

● A    #git add -A
● c    #git commit -m ''
● P    #git push

2022-12-12 16-06-48.2022-12-12 16_07_31.gif

● n        #git checkout -b test
● A        #git add -A
● c        #git commit -m 'add 2'
● space    #git checkout -b master
● M        #git merge test 

2022-12-12 16-15-58.2022-12-12 16_16_47.gif

reset 退回某一版本

 ● g   #git reset --soft hash
       #git reset --mixed hash
       #git reset --hard hash

2022-12-12 16-45-19.2022-12-12 16_46_19.gif