1
+ .. highlight :: bash
2
+
1
3
.. _configure-git :
2
4
3
5
===============
9
11
Overview
10
12
========
11
13
12
- Your personal git _ configurations are saved in the ``.gitconfig `` file in
14
+ Your personal git configurations are saved in the ``.gitconfig `` file in
13
15
your home directory.
14
- Here is an example ``.gitconfig `` file::
16
+
17
+ Here is an example ``.gitconfig `` file:
18
+
19
+ .. code-block :: none
15
20
16
21
[user]
17
22
name = Your Name
18
23
email = you@yourdomain.example.com
19
-
24
+
20
25
[alias]
21
26
ci = commit -a
22
27
co = checkout
23
- st = status -a
24
- stat = status -a
28
+ st = status
29
+ stat = status
25
30
br = branch
26
31
wdiff = diff --color-words
27
-
32
+
28
33
[core]
29
34
editor = vim
30
35
@@ -33,7 +38,7 @@ Here is an example ``.gitconfig`` file::
33
38
34
39
You can edit this file directly or you can use the ``git config --global ``
35
40
command::
36
-
41
+
37
42
git config --global user.name "Your Name"
38
43
git config --global user.email you@yourdomain.example.com
39
44
git config --global alias.ci "commit -a"
62
67
git config --global user.email you@yourdomain.example.com
63
68
64
69
This will write the settings into your git configuration file, which
65
- should now contain a user section with your name and email::
70
+ should now contain a user section with your name and email:
71
+
72
+ .. code-block :: none
66
73
67
74
[user]
68
75
name = Your Name
@@ -90,7 +97,9 @@ The following ``git config --global`` commands::
90
97
git config --global alias.wdiff "diff --color-words"
91
98
92
99
will create an ``alias `` section in your ``.gitconfig `` file with contents
93
- like this::
100
+ like this:
101
+
102
+ .. code-block :: none
94
103
95
104
[alias]
96
105
ci = commit -a
@@ -110,7 +119,9 @@ You may also want to make sure that your editor of choice is used ::
110
119
Merging
111
120
-------
112
121
113
- To enforce summaries when doing merges (``~/.gitconfig `` file again)::
122
+ To enforce summaries when doing merges (``~/.gitconfig `` file again):
123
+
124
+ .. code-block :: none
114
125
115
126
[merge]
116
127
log = true
@@ -119,5 +130,43 @@ Or from the command line::
119
130
120
131
git config --global merge.log true
121
132
133
+ .. _fancy-log :
134
+
135
+ Fancy log output
136
+ ----------------
137
+
138
+ This is a very nice alias to get a fancy log output; it should go in the
139
+ ``alias `` section of your ``.gitconfig `` file:
140
+
141
+ .. code-block :: none
142
+
143
+ lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)[%an]%Creset' --abbrev-commit --date=relative
144
+
145
+ You use the alias with::
146
+
147
+ git lg
148
+
149
+ and it gives graph / text output something like this (but with color!):
150
+
151
+ .. code-block :: none
152
+
153
+ * 6d8e1ee - (HEAD, origin/my-fancy-feature, my-fancy-feature) NF - a fancy file (45 minutes ago) [Matthew Brett]
154
+ * d304a73 - (origin/placeholder, placeholder) Merge pull request #48 from hhuuggoo/master (2 weeks ago) [Jonathan Terhorst]
155
+ |\
156
+ | * 4aff2a8 - fixed bug 35, and added a test in test_bugfixes (2 weeks ago) [Hugo]
157
+ |/
158
+ * a7ff2e5 - Added notes on discussion/proposal made during Data Array Summit. (2 weeks ago) [Corran Webster]
159
+ * 68f6752 - Initial implimentation of AxisIndexer - uses 'index_by' which needs to be changed to a call on an Axes object - this is all very sketchy right now. (2 weeks ago) [Corr
160
+ * 376adbd - Merge pull request #46 from terhorst/master (2 weeks ago) [Jonathan Terhorst]
161
+ |\
162
+ | * b605216 - updated joshu example to current api (3 weeks ago) [Jonathan Terhorst]
163
+ | * 2e991e8 - add testing for outer ufunc (3 weeks ago) [Jonathan Terhorst]
164
+ | * 7beda5a - prevent axis from throwing an exception if testing equality with non-axis object (3 weeks ago) [Jonathan Terhorst]
165
+ | * 65af65e - convert unit testing code to assertions (3 weeks ago) [Jonathan Terhorst]
166
+ | * 956fbab - Merge remote-tracking branch 'upstream/master' (3 weeks ago) [Jonathan Terhorst]
167
+ | |\
168
+ | |/
169
+
170
+ Thanks to Yury V. Zaytsev for posting it.
122
171
123
- .. include :: git_links .inc
172
+ .. include :: links .inc
0 commit comments