VersionCtl/git/magit/v3.3.0
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#topicpath
/////////////////////////////////////////////////////////...
* 目次 [#q8266b3d]
#contents();
#ls2(VersionCtl/git/magit/);
/////////////////////////////////////////////////////////...
* 導入方法(v.3.3.0) [#b57277ec]
- magit 本体を取得。
-- https://github.com/magit/magit.git
- 追加で以下が必要となる。repository の後ろの記載は tag
- https://github.com/magnars/dash.el.git 2.19.1
- https://github.com/magit/ghub.git v3.5.6
- https://github.com/magit/git-modes.git 1.4.0
- https://github.com/vermiculus/graphql.el.git 0.1.1
- https://github.com/magit/magit-popup.git v2.13.3
- https://github.com/volrath/treepy.el.git 0.1.2
- https://github.com/magit/with-editor.git v3.2.0
- https://github.com/magit/transient.git v0.3.0
- ${HOME}/.emacs.d/site-lisp/ 配下に手動インストールした...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(require 'magit)
//=======================================================...
** compile [#d79dedfd]
- 依存パッケージ(dash, transient, with-editor)へのパス...
-- 指定方法
magit/config.mk:
LOAD_PATH = -L ~/.emacs.d/site-lisp/magit/lisp
LOAD_PATH += -L ~/.emacs.d/site-lisp/dash
LOAD_PATH += -L ~/.emacs.d/site-lisp/transient/lisp
LOAD_PATH += -L ~/.emacs.d/site-lisp/with-editor
--- see also: magit/Documentation/magit.info
- graphql
-- make を実行するのに、yq (jq の wrapper。[[yqの入手元(G...
-- jq は debian なら jq パッケージで導入可。
/////////////////////////////////////////////////////////...
* コマンド [#z1b11beb]
|~binding |~command |~description |~rem...
| b |magit-branching |ブランチ操作 | |
| y |magit-show-refs-popup |ブランチ一覧 | |
| C-j |magit-diff-visit-worktree-file | | |
| C |magit-commit-add-log | | |
| K |magit-file-untrack | | |
| R |magit-file-rename | | |
| a |magit-apply | | |
| s |magit-stage | | |
| u |magit-unstage | | |
| <C-return> |magit-diff-visit-file-worktree | | |
| <remap> |Prefix Command | | |
|C-c C-e |magit-diff-edit-hunk-commit | | |
|C-c C-t |magit-diff-trace-definition | | |
| <remap> <magit-delete-thing> |magit-discard | | |
| <remap> <magit-revert-no-commit> |magit-reverse | | |
| <remap> <magit-visit-thing> |magit-diff-visit-file | | |
|C-x a |magit-add-change-log-entr...
|C-x 5 <return> |magit-diff-visit-file-oth...
|C-x 4 a |magit-add-change-log-entr...
|C-x 4 <return> |magit-diff-visit-file-oth...
- 各 pop-up ウインドウを抜ける時は、 "q" → "C-g" へ変更に...
- 各 pop-up ウインドウ表示中、カーソルキー、ウインドウ間...
*** Major Mode Bindings: [#x47a5433]
|~binding |~command |~remark |
| C-c |Prefix Command | |
| TAB |magit-section-toggle | |
| RET |magit-visit-thing | |
| C-w |magit-copy-section-value | |
// | C-x |Prefix Command | |
| ESC |Prefix Command | |
| SPC |magit-diff-show-or-scroll-up | |
| ! |magit-run | |
| $ |magit-process-buffer | |
| % |magit-worktree | |
| + |magit-diff-more-context | |
| - |magit-diff-less-context | |
| 0 |magit-diff-default-context | |
| 1 |magit-section-show-level-1 | |
| 2 |magit-section-show-level-2 | |
| 3 |magit-section-show-level-3 | |
| 4 |magit-section-show-level-4 | |
| 5 .. 9 |digit-argument | |
| : |magit-git-command | |
| < |beginning-of-buffer | |
| > |end-of-buffer | |
| ? |magit-dispatch | |
| A |magit-cherry-pick |git cherry-pic の操作メニュ...
| B |magit-bisect | |
| D |magit-diff-refresh | |
| E |magit-ediff |git diff の操作メニューを表...
| F |magit-pull |pull の操作メニュー・・・は...
| G |magit-refresh-all | |
| H |magit-describe-section|git describe を実行(一番最...
| I |magit-gitignore | |
| L |magit-log-refresh | |
| M |magit-remote |git remote の操作メニューを...
| O |magit-subtree | |
| P |magit-push |git push の操作メニューを表...
| S |magit-stage-modified | |
| T |magit-notes | |
| U |magit-unstage-all |stage されている全てのファ...
| V |magit-revert | |
| W |magit-patch | |
| X |magit-reset |git reset の操作メニューを...
| Y |magit-cherry | |
| Z |magit-stash |git stash の操作メニューを...
| ^ |magit-section-up | |
| b |magit-branch |git branch の操作メニューを...
| b b |magit-checkout |任意のブランチを checkout ...
| c |magit-commit |git commit の操作メニューを...
| d |magit-diff | |
| e |magit-ediff-compare | |
| f |magit-fetch | |
| g |magit-refresh | |
| h |magit-dispatch | |
| i |magit-gitignore | |
| j |magit-status-jump | |
| k |magit-delete-thing | |
| l |magit-log |git log の操作メニューを表...
| m |magit-merge | |
| n |magit-section-forward | |
| o |magit-submodule | |
| p |magit-section-backward | |
| q |magit-mode-bury-buffer | |
| r |magit-rebase | |
// | s |magit-stage-file |選択中のファイルを stage ...
| t |magit-tag |git tag の操作メニューを表...
// | u |magit-unstage-file |選択中のファイルを unstage...
| v |magit-revert-no-commit | |
| w |magit-am | |
| x |magit-reset-quickly | |
| y |magit-show-refs |branch 操作の操作メニューを表示。...
| z |magit-stash |git stash の操作メニューを表示 |
| DEL |magit-diff-show-or-scroll-down | |
| S-SPC |~| |
| <C-tab> |magit-section-cycle | |
| <M-tab> |magit-section-cycle-diffs | |
| <backtab> |magit-section-cycle-global | |
| <remap> |Prefix Command | |
| <s-tab> |magit-section-cycle-global | |
| <remap> <dired-jump> |magit-dired-jump | |
// | j f |Prefix Command | |
// | j n |magit-jump-to-untracked | |
// | j p |Prefix Command | |
// | j s |magit-jump-to-staged | |
// | j t |magit-jump-to-tracked | |
// | j u |magit-jump-to-unstaged | |
// | j z |magit-jump-to-stashes | |
| C-c C-c |magit-dispatch | |
| C-c C-o |magit-browse-thing | |
| C-c C-w |~| |
// | C-x 4 |Prefix Command | |
// | C-x a |magit-add-change-log-entry | |
// | M-RET |magit-dired-jump | |
| C-M-i |magit-dired-jump | |
| M-w |magit-copy-buffer-revision | |
| M-1 |magit-section-show-level-1-all | |
| M-2 |magit-section-show-level-2-all | |
| M-3 |magit-section-show-level-3-all | |
| M-4 |magit-section-show-level-4-all | |
| M-n |magit-section-forward-sibling | |
| M-p |magit-section-backward-sibling | |
// | M-w |magit-copy-buffer-revision | |
// | <remap> <evil-next-line> |evil-next-visual-line | |
// | <remap> <evil-previous-line> |evil-previous-visual-l...
// | j p p |magit-jump-to-unpushed-to-pushremote | |
// | j p u |magit-jump-to-unpushed-to-upstream | |
// | j f p |magit-jump-to-unpulled-from-pushremote | |
// | j f u |magit-jump-to-unpulled-from-upstream | |
// | C-x 4 a |magit-add-change-log-entry-other-window | |
//=======================================================...
** diff [#ue374e66]
- リポジトリと差分のあるファイルのファイル名の上で "e" を...
- この diff の画面は、ある時期に 2ペインから3ペインに変更...
|~画面 |~関数 |
|2ペイン |magit-ediff-compare |
|3ペイン |magit-ediff-dwim |
- 最新の magit で、差分編集を以前の2ペインにしたい場合は...
(define-key magit-mode-map "e" 'magit-ediff-compare)
-- これで、若干面倒ではあるが(その代わり比較対象をどのブ...
-- 但し、conflict 解決の場合に magit-diff-compare を起動...
→ ''"e"'' と ''"E"'' で両者を使い分けると良いだろう。
/////////////////////////////////////////////////////////...
* ユースケース [#sd7c349b]
//=======================================================...
** 部分ステージング&コミット [#b6c3358e]
+ M-x: magit-status を実行
+ ''Unstaged changes'' にリストされているファイルの内、部...
+ 部分ステージング&コミットしたい差分のところにカーソル...
+ magit 上での通常の commit 操作と同じ c, c, C-c で commi...
/////////////////////////////////////////////////////////...
* 設定 [#t4e268a1]
//=======================================================...
** log の日付表示設定 [#e3250a81]
- magit-log では、"1 week", "2 years" などと大まかな時期...
- 日時での表示に切り替えるには、${HOME}/.emacs.d/init.el ...
(eval-after-load "magit-log"
'(progn
(custom-set-variables
'(magit-log-margin '(t "%Y-%m-%d %H:%M:%S " magit-...
- 上記でフォーマット文字列の最後に空白文字を入れているの...
//=======================================================...
** log の commit ID の表示色の設定 [#j1e8b433]
- default では暗目のグレーになっており、黒背景の場合には...
(custom-set-faces
'(magit-hash ((t (:foreground "white")))) ; log の comm...
;'(magit-section-highlight ((t (:background "blue")))) ...
)
//-------------------------------------------------------...
*** 参考リンク [#o9c300fd]
- [[magitのログを、コミット時期ではなくコミット時刻で表示...
終了行:
#topicpath
/////////////////////////////////////////////////////////...
* 目次 [#q8266b3d]
#contents();
#ls2(VersionCtl/git/magit/);
/////////////////////////////////////////////////////////...
* 導入方法(v.3.3.0) [#b57277ec]
- magit 本体を取得。
-- https://github.com/magit/magit.git
- 追加で以下が必要となる。repository の後ろの記載は tag
- https://github.com/magnars/dash.el.git 2.19.1
- https://github.com/magit/ghub.git v3.5.6
- https://github.com/magit/git-modes.git 1.4.0
- https://github.com/vermiculus/graphql.el.git 0.1.1
- https://github.com/magit/magit-popup.git v2.13.3
- https://github.com/volrath/treepy.el.git 0.1.2
- https://github.com/magit/with-editor.git v3.2.0
- https://github.com/magit/transient.git v0.3.0
- ${HOME}/.emacs.d/site-lisp/ 配下に手動インストールした...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(setq load-path (cons (expand-file-name "~/.emacs.d/sit...
(require 'magit)
//=======================================================...
** compile [#d79dedfd]
- 依存パッケージ(dash, transient, with-editor)へのパス...
-- 指定方法
magit/config.mk:
LOAD_PATH = -L ~/.emacs.d/site-lisp/magit/lisp
LOAD_PATH += -L ~/.emacs.d/site-lisp/dash
LOAD_PATH += -L ~/.emacs.d/site-lisp/transient/lisp
LOAD_PATH += -L ~/.emacs.d/site-lisp/with-editor
--- see also: magit/Documentation/magit.info
- graphql
-- make を実行するのに、yq (jq の wrapper。[[yqの入手元(G...
-- jq は debian なら jq パッケージで導入可。
/////////////////////////////////////////////////////////...
* コマンド [#z1b11beb]
|~binding |~command |~description |~rem...
| b |magit-branching |ブランチ操作 | |
| y |magit-show-refs-popup |ブランチ一覧 | |
| C-j |magit-diff-visit-worktree-file | | |
| C |magit-commit-add-log | | |
| K |magit-file-untrack | | |
| R |magit-file-rename | | |
| a |magit-apply | | |
| s |magit-stage | | |
| u |magit-unstage | | |
| <C-return> |magit-diff-visit-file-worktree | | |
| <remap> |Prefix Command | | |
|C-c C-e |magit-diff-edit-hunk-commit | | |
|C-c C-t |magit-diff-trace-definition | | |
| <remap> <magit-delete-thing> |magit-discard | | |
| <remap> <magit-revert-no-commit> |magit-reverse | | |
| <remap> <magit-visit-thing> |magit-diff-visit-file | | |
|C-x a |magit-add-change-log-entr...
|C-x 5 <return> |magit-diff-visit-file-oth...
|C-x 4 a |magit-add-change-log-entr...
|C-x 4 <return> |magit-diff-visit-file-oth...
- 各 pop-up ウインドウを抜ける時は、 "q" → "C-g" へ変更に...
- 各 pop-up ウインドウ表示中、カーソルキー、ウインドウ間...
*** Major Mode Bindings: [#x47a5433]
|~binding |~command |~remark |
| C-c |Prefix Command | |
| TAB |magit-section-toggle | |
| RET |magit-visit-thing | |
| C-w |magit-copy-section-value | |
// | C-x |Prefix Command | |
| ESC |Prefix Command | |
| SPC |magit-diff-show-or-scroll-up | |
| ! |magit-run | |
| $ |magit-process-buffer | |
| % |magit-worktree | |
| + |magit-diff-more-context | |
| - |magit-diff-less-context | |
| 0 |magit-diff-default-context | |
| 1 |magit-section-show-level-1 | |
| 2 |magit-section-show-level-2 | |
| 3 |magit-section-show-level-3 | |
| 4 |magit-section-show-level-4 | |
| 5 .. 9 |digit-argument | |
| : |magit-git-command | |
| < |beginning-of-buffer | |
| > |end-of-buffer | |
| ? |magit-dispatch | |
| A |magit-cherry-pick |git cherry-pic の操作メニュ...
| B |magit-bisect | |
| D |magit-diff-refresh | |
| E |magit-ediff |git diff の操作メニューを表...
| F |magit-pull |pull の操作メニュー・・・は...
| G |magit-refresh-all | |
| H |magit-describe-section|git describe を実行(一番最...
| I |magit-gitignore | |
| L |magit-log-refresh | |
| M |magit-remote |git remote の操作メニューを...
| O |magit-subtree | |
| P |magit-push |git push の操作メニューを表...
| S |magit-stage-modified | |
| T |magit-notes | |
| U |magit-unstage-all |stage されている全てのファ...
| V |magit-revert | |
| W |magit-patch | |
| X |magit-reset |git reset の操作メニューを...
| Y |magit-cherry | |
| Z |magit-stash |git stash の操作メニューを...
| ^ |magit-section-up | |
| b |magit-branch |git branch の操作メニューを...
| b b |magit-checkout |任意のブランチを checkout ...
| c |magit-commit |git commit の操作メニューを...
| d |magit-diff | |
| e |magit-ediff-compare | |
| f |magit-fetch | |
| g |magit-refresh | |
| h |magit-dispatch | |
| i |magit-gitignore | |
| j |magit-status-jump | |
| k |magit-delete-thing | |
| l |magit-log |git log の操作メニューを表...
| m |magit-merge | |
| n |magit-section-forward | |
| o |magit-submodule | |
| p |magit-section-backward | |
| q |magit-mode-bury-buffer | |
| r |magit-rebase | |
// | s |magit-stage-file |選択中のファイルを stage ...
| t |magit-tag |git tag の操作メニューを表...
// | u |magit-unstage-file |選択中のファイルを unstage...
| v |magit-revert-no-commit | |
| w |magit-am | |
| x |magit-reset-quickly | |
| y |magit-show-refs |branch 操作の操作メニューを表示。...
| z |magit-stash |git stash の操作メニューを表示 |
| DEL |magit-diff-show-or-scroll-down | |
| S-SPC |~| |
| <C-tab> |magit-section-cycle | |
| <M-tab> |magit-section-cycle-diffs | |
| <backtab> |magit-section-cycle-global | |
| <remap> |Prefix Command | |
| <s-tab> |magit-section-cycle-global | |
| <remap> <dired-jump> |magit-dired-jump | |
// | j f |Prefix Command | |
// | j n |magit-jump-to-untracked | |
// | j p |Prefix Command | |
// | j s |magit-jump-to-staged | |
// | j t |magit-jump-to-tracked | |
// | j u |magit-jump-to-unstaged | |
// | j z |magit-jump-to-stashes | |
| C-c C-c |magit-dispatch | |
| C-c C-o |magit-browse-thing | |
| C-c C-w |~| |
// | C-x 4 |Prefix Command | |
// | C-x a |magit-add-change-log-entry | |
// | M-RET |magit-dired-jump | |
| C-M-i |magit-dired-jump | |
| M-w |magit-copy-buffer-revision | |
| M-1 |magit-section-show-level-1-all | |
| M-2 |magit-section-show-level-2-all | |
| M-3 |magit-section-show-level-3-all | |
| M-4 |magit-section-show-level-4-all | |
| M-n |magit-section-forward-sibling | |
| M-p |magit-section-backward-sibling | |
// | M-w |magit-copy-buffer-revision | |
// | <remap> <evil-next-line> |evil-next-visual-line | |
// | <remap> <evil-previous-line> |evil-previous-visual-l...
// | j p p |magit-jump-to-unpushed-to-pushremote | |
// | j p u |magit-jump-to-unpushed-to-upstream | |
// | j f p |magit-jump-to-unpulled-from-pushremote | |
// | j f u |magit-jump-to-unpulled-from-upstream | |
// | C-x 4 a |magit-add-change-log-entry-other-window | |
//=======================================================...
** diff [#ue374e66]
- リポジトリと差分のあるファイルのファイル名の上で "e" を...
- この diff の画面は、ある時期に 2ペインから3ペインに変更...
|~画面 |~関数 |
|2ペイン |magit-ediff-compare |
|3ペイン |magit-ediff-dwim |
- 最新の magit で、差分編集を以前の2ペインにしたい場合は...
(define-key magit-mode-map "e" 'magit-ediff-compare)
-- これで、若干面倒ではあるが(その代わり比較対象をどのブ...
-- 但し、conflict 解決の場合に magit-diff-compare を起動...
→ ''"e"'' と ''"E"'' で両者を使い分けると良いだろう。
/////////////////////////////////////////////////////////...
* ユースケース [#sd7c349b]
//=======================================================...
** 部分ステージング&コミット [#b6c3358e]
+ M-x: magit-status を実行
+ ''Unstaged changes'' にリストされているファイルの内、部...
+ 部分ステージング&コミットしたい差分のところにカーソル...
+ magit 上での通常の commit 操作と同じ c, c, C-c で commi...
/////////////////////////////////////////////////////////...
* 設定 [#t4e268a1]
//=======================================================...
** log の日付表示設定 [#e3250a81]
- magit-log では、"1 week", "2 years" などと大まかな時期...
- 日時での表示に切り替えるには、${HOME}/.emacs.d/init.el ...
(eval-after-load "magit-log"
'(progn
(custom-set-variables
'(magit-log-margin '(t "%Y-%m-%d %H:%M:%S " magit-...
- 上記でフォーマット文字列の最後に空白文字を入れているの...
//=======================================================...
** log の commit ID の表示色の設定 [#j1e8b433]
- default では暗目のグレーになっており、黒背景の場合には...
(custom-set-faces
'(magit-hash ((t (:foreground "white")))) ; log の comm...
;'(magit-section-highlight ((t (:background "blue")))) ...
)
//-------------------------------------------------------...
*** 参考リンク [#o9c300fd]
- [[magitのログを、コミット時期ではなくコミット時刻で表示...
ページ名: