美文网首页
DT - 插件,工具,快捷键

DT - 插件,工具,快捷键

作者: Yong_bcf4 | 来源:发表于2022-05-31 18:15 被阅读0次
  • vs code 快捷键
KeyboardReferenceSheet.png
  • zsh 缩写,提高代码提交效率

    快捷键实现原理

    这里只说 oh-my-zsh 针对 git 的改进。为什么支持缩写的形式。

    大家可能知道 git 的快捷键 alias,它允许我们自己配制快捷键。例如

    1. alias gst='git status'

    2. alias gp='git push'

    3. alias gp='git push'

    需要配置的快捷键过多,如果对 git 操作了解不够深入的人无法自行配置。那么 oh-my-zsh 是如何实现的呢?

    其实就是用的 alias ,这里是 Github 上的链接 https://github.com/robbyrusse... ,通过 url 便知这里的master分支下,plugins插件目录,git插件下的配置文件。

    喜欢阅读代码的直接点击链接查看所有快捷键实现。这里便于整理把平时工作常用的快捷键给大家,至于不常用的大家查看 Github 上的链接,可能记得多了这种对应关系容易弄混,建议大家只熟练记忆工作常有的快捷键,其它可以按着 git 官方文档去做。减少出错和不必要的麻烦。

    常用快捷键

  1. g - git

  2. gst - git status

  3. gl - git pull

  4. gup - git pull --rebase

  5. gp - git push

  6. gd - git diff

  7. gcmsg - git commit -m

  8. gco - git checkout

  9. gcm - git checkout master

  10. grb - git rebase

  11. gba - git branch -a

  12. gcp - git cherry-pick

  13. glg - git log --stat --max-count=10

  14. glgg - git log --graph --max-count=10

  15. glgga - git log --graph --decorate --all

  16. glo - git log --oneline --decorate --color

  17. glog - git log --oneline --decorate --color --graph

  18. gss - git status -s

  19. ga - git add

  20. gm - git merge

  21. grh - git reset HEAD

  22. grhh - git reset HEAD --hard

  23. gclean - git reset --hard && git clean -dfx

  24. gsta - git stash

  25. gstp - git stash pop

  26. gstd - git stash drop

更多缩写链接: https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh

相关文章

网友评论

      本文标题:DT - 插件,工具,快捷键

      本文链接:https://www.haomeiwen.com/subject/zmnxmrtx.html