forked from mtdavidson/magit-cheatsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
magitCheatsheet.tex
168 lines (143 loc) · 4.03 KB
/
magitCheatsheet.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
\documentclass[11pt,a4paper]{article}
\def\eqlistlabel#1{\bfseries#1}
\usepackage[cm]{fullpage}
\usepackage{multicol}
\usepackage{eqlist}
\usepackage[pdftex]{hyperref}
\usepackage{nopageno}
\setcounter{secnumdepth}{-1}
\hypersetup{
pdfauthor={Mark Davidson},
pdftitle={Magit Cheatsheet},
pdfstartview={FitH}
}
\begin{document}
\begin{center}
{
\huge \bfseries Magit Cheatsheet
\vspace{0.5 cm}
}
\end{center}
\begin{multicols}{2}
\section{Buffers}
\begin{eqlist}
\item[M-x magit-status] Magit's status buffer
\item[\$] magit-process buffer
\item[g] reload status buffer
\end{eqlist}
\section{Section Visibility}
\begin{eqlist}
\item[TAB] Toggle visibility of current section
\item[S-TAB] Toggle visibility of current section and its children
\item[1,2,3,4] Expand current section to the corresponding level of
detail - 1,2,3 or 4
\item[M-1,2,3,4] Expand all sections to the corresponding level of
detail - 1,2,3 or 4
\end{eqlist}
\section{Untracked Files}
\begin{eqlist}
\item[s] Add untracked file to staging area
\item[i] Add file to .gitignore
\item[C-u i] Prompt for file/directory to add to .gitignore
\item[I] Add file to .git/info/exclude instead of .gitignore
\end{eqlist}
\section{Staging and Committing}
\begin{eqlist}
\item[s] Stage current hunk
\item[u] Unstage current hunk
\item[S] Stage all hunks
\item[U] Unstage all hunks
\item[k] Discard uncommitted changes
\item[c] Prepare for commit
\item[C-c C-c] Execute commit
\item[C-c C-a] Make the next commit an amend
\end{eqlist}
\section{History}
\begin{eqlist}
\item[l] History
\item[L] Verbose history
\item[C-u l] History segment
\item[RET] Inspect commit
\item[a] Stage current commit on your branch
\item[A] Commit current commit on your current branch
\item[C-w] Copy sha1 of current commit into kill ring
\item[=] Show differences between current and marked commits
\item[..] Make current commit
\item[.] Unmark current commit if marked
\item[C-u ..] Unmake marked commit from anywhere
\end{eqlist}
\section{Reflogs}
\begin{eqlist}
\item[h] Browse reflog from HEAD
\item[H] Browse reflog from chosen point
\end{eqlist}
\section{Diffing}
\begin{eqlist}
\item[d] Show changes between working tree and HEAD
\item[D] Show changes between two arbitrary revisions
\item[a] Apply current changes to working tree
\item[v] Apply current changes to working tree in reverse
\end{eqlist}
\section{Tagging}
\begin{eqlist}
\item[t] Make lightweight tag
\item[T] Prepare annotated tag
\item[C-c C-c] Commit annotated tag
\end{eqlist}
\section{Resetting}
\begin{eqlist}
\item[x] Reset your current head to chosen revision
\item[X] Reset working tree and staging area to most recent commit state
\end{eqlist}
\section{Stashing}
\begin{eqlist}
\item[z] Create new stash
\item[Z] Create new stash and maintain state
\item[RET] View stash
\item[a] Apply stash
\item[A] Pop stash
\item[k] Drop stash
\end{eqlist}
\section{Branching}
\begin{eqlist}
\item[b] Switch to different branch
\item[B] Create and switch to new branch
\end{eqlist}
\section{Wazzup}
\begin{eqlist}
\item[W] Show summary of how other branches relate to current branch
\item[i] Toggle ignore branch
\item[C-U w] Show all branches including ignored ones
\end{eqlist}
\section{Merging}
\begin{eqlist}
\item[m] Initiate manual merge
\item[M] Initiate automatic merge
\item[R] Initiate of continue a rebase
\end{eqlist}
\section{Rewriting}
\begin{eqlist}
\item[r s] Start a rewrite
\item[v] Revert a given commit
\item[r t] remove bookkeeping information from buffer
\item[r a] Abort rewriting
\item[r f] Finish rewriting
\item[r *] Toggle the * mark on pending commit
\item[r ..] Toggle the .. mark on pending commit
\end{eqlist}
\section{Pushing and Pulling}
\begin{eqlist}
\item[P] git push
\item[C-u P] git push to specified remote repository
\item[f] git remote update
\item[F] git pull
\end{eqlist}
\section{Interface with Subversion}
\begin{eqlist}
\item[N r] git svn rebase
\item[N c] git svn dcommit
\end{eqlist}
\end{multicols}
\let\thefootnote\relax\footnotetext{Based on magit cheatsheet from
http://daemianmack.com/magit-cheatsheet.html}
\end{document}