SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
優雅的在 Emacs 中
使⽤用 git
Cosucp 2013
Superbil (鄭開元)
About Me
•軟體⼯工程師、iOS 開發
•Emacs 使⽤用經驗⼤大約 1 年
•Git 使⽤用經驗⼤大約 4 年
•PyHUG 主持⼈人
•about.me/superbil
•freenode #emacs.tw #g0v.tw
#python.tw on ircCloud
Outline
• What is Emacs ?
• What is Git ?
• Magit
• Live Demo
什麼是 Emacs ?
編輯器
Why I use Emacs?
• Magit
• Org-mode
• eshell
• ansi-term
run zshell
Emacs 基本介紹
• Ctrl + h t // emacs tutorial
• Ctrl + {b,n,p,f} // h j k l
• Ctrl + x b // 切換 buffer
• Ctrl + x Ctrl + e // 執⾏行 ( ) 中的 elisp
• Ctrl + h m // 查詢當下 mode 的⽂文件
Emacs 的熱鍵很難按
更換你的 Ctrl 鍵位置
• Caps Lock 其實⼀一點都不重要
• Ctrl 在下⾯面的位置其實是⾮非常難按的
巨⼈人出現了阿!!!
Emacs in better than
X !
政治正確
為何不同時使⽤用
Emacs 和Vim ?
by 程序员时髦值指南
同时⽤用 Vim 和
Emacs,这⼈人早
被烧死了
什麼是
什麼是 Git ?
• Git 是版本控管系統
• 管理程式碼、⽂文件資源、法規(?)
• Git 是分散式的,內容都在本地端
• Git 很快
Git 更新流程
base command for git
• status
顯⽰示狀態
• push
把本地推去雲端
• pull
抓雲端資料下來
• add
新增檔案到 stash
• commit
把⺫⽬目前狀態寫⼊入log
• log
歷史記錄
• rebase
重寫歷史記錄
新增到 staging area 時,
選擇要的區塊
可以以⾏行為單位,⽽而不是以檔案
每⼀一次的 commit log 更加乾淨
git add --patch
Magit
best way use git in Emacs
What is Magit ?
• git GUI on Emacs
• that's is very good for keyboard fans
Different with vc
• VC
• 使⽤用相同的熱鍵和使⽤用 SCM
git, svn, etc...
• Magit
• 從 Git 的⾏行為來提供使⽤用者介⾯面
Magit 介⾯面簡介
Show Sections
Magit commit 介⾯面
History
Write changelog
Live Demo
Oops... Magit
沒⽀支援的功能
• M-x magit-git-command
• hotkey is ‘:’ <your action>
• this will run
`git --no-pager <your action>`
Some useful mode
• org-magit
link to magit-status
use '~/project/kuansim/::status'
Q & A
Learn more about
Magit
• Emacs: magit-mode Tutorial
• EmacsWiki: Magit
• Magit User Manual
Thank you

Contenu connexe

Similaire à 優雅的在 Emacs 中使用 git

Intro to Git 投影片
Intro to Git 投影片Intro to Git 投影片
Intro to Git 投影片Tony Yeh
 
Code review on github training ( beginner )
Code review on github training ( beginner )Code review on github training ( beginner )
Code review on github training ( beginner )JS Lee
 
Git raiders of junior
Git raiders of juniorGit raiders of junior
Git raiders of juniorKevin Chen
 
Continuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIContinuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIChu-Siang Lai
 
Git 入門與實作
Git 入門與實作Git 入門與實作
Git 入門與實作奕浦 郭
 
.net framework from 1.0 -> 4.0
.net framework from 1.0 -> 4.0.net framework from 1.0 -> 4.0
.net framework from 1.0 -> 4.0ligaoren
 
Mercurial簡介與教學
Mercurial簡介與教學Mercurial簡介與教學
Mercurial簡介與教學芳本 林
 
Git and Github basic with SourceTree
Git and Github basic with SourceTreeGit and Github basic with SourceTree
Git and Github basic with SourceTreeChu-Siang Lai
 
Phonagp 简介
Phonagp 简介Phonagp 简介
Phonagp 简介dong yuwei
 
Learn git
Learn gitLearn git
Learn git甘 李
 
Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Chu-Siang Lai
 
Git使用进阶
Git使用进阶Git使用进阶
Git使用进阶Han Qin
 
Git 使用介绍
Git 使用介绍Git 使用介绍
Git 使用介绍medcl
 
Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Will Huang
 
JavaScript 80+ Programming and Optimization Skills
JavaScript 80+ Programming and Optimization SkillsJavaScript 80+ Programming and Optimization Skills
JavaScript 80+ Programming and Optimization SkillsHo Kim
 
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIContinuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIChu-Siang Lai
 
VIM入门与进阶
VIM入门与进阶VIM入门与进阶
VIM入门与进阶pan weizeng
 

Similaire à 優雅的在 Emacs 中使用 git (20)

Intro to Git 投影片
Intro to Git 投影片Intro to Git 投影片
Intro to Git 投影片
 
Code review on github training ( beginner )
Code review on github training ( beginner )Code review on github training ( beginner )
Code review on github training ( beginner )
 
Git raiders of junior
Git raiders of juniorGit raiders of junior
Git raiders of junior
 
Continuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIContinuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CI
 
Git 入門與實作
Git 入門與實作Git 入門與實作
Git 入門與實作
 
.net framework from 1.0 -> 4.0
.net framework from 1.0 -> 4.0.net framework from 1.0 -> 4.0
.net framework from 1.0 -> 4.0
 
Mercurial簡介與教學
Mercurial簡介與教學Mercurial簡介與教學
Mercurial簡介與教學
 
Git and Github basic with SourceTree
Git and Github basic with SourceTreeGit and Github basic with SourceTree
Git and Github basic with SourceTree
 
Phonagp 简介
Phonagp 简介Phonagp 简介
Phonagp 简介
 
Learn git
Learn gitLearn git
Learn git
 
Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)
 
Github簡介
Github簡介Github簡介
Github簡介
 
Git使用进阶
Git使用进阶Git使用进阶
Git使用进阶
 
20160420 - git intro
20160420 - git intro20160420 - git intro
20160420 - git intro
 
Git Tutorial 教學
Git Tutorial 教學Git Tutorial 教學
Git Tutorial 教學
 
Git 使用介绍
Git 使用介绍Git 使用介绍
Git 使用介绍
 
Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)
 
JavaScript 80+ Programming and Optimization Skills
JavaScript 80+ Programming and Optimization SkillsJavaScript 80+ Programming and Optimization Skills
JavaScript 80+ Programming and Optimization Skills
 
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIContinuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CI
 
VIM入门与进阶
VIM入门与进阶VIM入门与进阶
VIM入门与进阶
 

優雅的在 Emacs 中使用 git