#topicpath

///////////////////////////////////////////////////////////////////////////////
* 目次 [#o9fa6d61]
#contents();

///////////////////////////////////////////////////////////////////////////////
* magit [#ycbd3850]
- [[emacs>Editor/emacsen]] 上で動作する、[[git>VersionCtl/Git]] フロントエンド

//=============================================================================
** 導入方法 [#installing]
- Linux の場合、ディストリビューションによっては用意されている場合もある
-- debian の場合、 magit パッケージを aptitude install すると、即使えるようになる。
- リポジトリ: https://github.com/magit/magit.git
- 最近のバージョンでは dash.el を必要とする。導入済みでない場合は用意しておく必要がある。
-- dash.el のリポジトリ: https://github.com/magnars/dash.el
-- with-editor のリポジトリ: https://github.com/magit/with-editor.git


- ${HOME}/.emacs.d/site-lisp/ 配下に手動インストールした場合の設定例。magit と dash に load-path も通す必要がある。
 ; magit
 (setq load-path (cons (expand-file-name "~/.emacs.d/site-lisp/dash") load-path))
 (load-library "~/.emacs.d/site-lisp/dash/dash.el")
 (setq load-path (cons (expand-file-name "~/.emacs.d/site-lisp/with-editor") load-path))
 (load-library "~/.emacs.d/site-lisp/with-editor/with-editor.el")
 (setq load-path (cons (expand-file-name "~/.emacs.d/site-lisp/magit") load-path))
 (load-library "~/.emacs.d/site-lisp/magit/magit.el")
- emacs23 以下の emacs 環境では、 defvar-local 関数が存在しない関係で、使える magit のバージョンは 1.2.2 以下となる。

- with-editor.el は元々 magit に組み込まれていたが、下記の commit 以降で外に出されており、別途自分で組み込む必要がある
 commit e87fe8180b6513450a110b7ad4fed887895720c3
 Author: Jonas Bernoulli <jonas@bernoul.li>
 Date:   Thu Jan 28 21:01:06 2016 +0100
 
     move with-editor to its own repository

///////////////////////////////////////////////////////////////////////////////
* コマンド [#o7c058aa]
- magit のキーバインドは、バージョンによって幾つか変更されているものがあるので注意が必要。~
Version 2.1.0 であれば "h" でhelp を参照出来、2ストロークなキーバインドのものについては都度コマンド候補が表示されるので、それを参照すれば良い。

|~binding |~command |~remark |
|M-x: magit-status | magit-mode 起動 | |
| h | magit のヘルプを表示 | |
| s | git add | 選択中のファイルを stage に追加(commitの対象に)する |
| S |全ファイルを stage に追加する | |
| u |ファイルを stage から降ろす | |
| U |全ファイルを stage から降ろす | |
| c |commit log を書く | |
| C-c C-c | git commit | commit する |
| C-c C-a | git commit --amend | commit をやり直す |
| P | git push | commit した変更を push する |
| l | git log | log を表示する。 l-l でshort log, l-L で verbose な log を表示する |
| z | git stash | stash を作成する |
| a | git stash apply | stash を適用(apply)する |
| A | git stash pop | stash を pop (最新の stash を適用し、その stash を list から削除)する |
| k | git stash drop | stash を drop(最新の stash 1つを list から削除)する |
| b | | branch-manager を起動する |
| %%b%% y | | branch-manager を起動する&br;(26/11/2015 以降、従来の magit-branch-manager に代わり、新たな I/F が "y" で起動するようになった) |
| f f | git fetch (Current) | |
| f o | git fetch (commit) | |
| f a | git fetch (all remotes) | |
| m | git merge | |
| F | git pull | |
| M-x: magit-reflog | git reflog |そのリポジトリ上で行った git の操作履歴を表示する |
| d | git diff |ローカルの編集差分の表示 |
| r | git rebase | |
| t |git tag | tag を作成する |
| T |~|~|

///////////////////////////////////////////////////////////////////////////////
* link [#y086fb37]
- [[magit.el を試してみた>http://gom.hatenablog.com/entry/20090524/1243170341]]
- [[[git][emacs] magitメモ>http://w.koshigoe.jp/study/?%5Bgit%5D%5Bemacs%5D+magit%A5%E1%A5%E2]]
- [[Magitユーザーマニュアル>https://docs.google.com/document/d/1v1lw539dpN3EVksU-CAjD-4vFeb_w3Ez3Y2RfVlE2F8/edit]]


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS