I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

  1. #+TITLE: Magit
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle magit.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export :comments org
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  8. Handle all of the git interactions inside of Emacs.
  9. * Setup
  10. Deploy the global configuration file for ~git~[fn:1], by default it reads from =$HOME/.gitconfig=.
  11. #+begin_src emacs-lisp
  12. (dotfiles/symlink "~/.emacs.d/config/git"
  13. "~/.gitconfig")
  14. #+end_src
  15. * Config
  16. Another hallmark feature of Emacs is ~magit~[fn:2]. It's a complete git porcelain inside of Emacs. The developer has stressed that it's most unfortunate name was meant to be pronounced like *magic* but with *git*. Despire his best efforts a lot of people have taken to pronouncing it *maggot*, which keeps him awake at night (probably).
  17. #+begin_src emacs-lisp
  18. (use-package magit
  19. :commands magit-status
  20. :custom (magit-display-buffer-function
  21. #'magit-display-buffer-same-window-except-diff-v1))
  22. #+end_src
  23. ** Forge integration
  24. It's possible to interact with forges from Github / Gitlab using ~forge~[fn:3]. It requires the respective =$TOKEN= to be configured, or an alternative form of authentication. This enables working with pull-requests, code-reviews, and issues from inside of Emacs.
  25. #+begin_src emacs-lisp
  26. (use-package forge
  27. :after magit)
  28. #+end_src
  29. * Shortcuts
  30. Interact with ~magit~[fn:2] behind =SPC g=:
  31. + Clone with =c=
  32. + Status with =g=
  33. #+begin_src emacs-lisp
  34. (dotfiles/leader
  35. "g" '(:ignore t :which-key "Magit")
  36. "gc" '(magit-clone :which-key "Clone")
  37. "gg" '(magit-status :which-key "Status"))
  38. #+end_src
  39. * Footnotes
  40. [fn:1] https://git-scm.com
  41. [fn:2] https://github.com/magit/magit
  42. [fn:3] https://github.com/magit/forge