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
@@ -20,8 +25,8 @@ Here is an example ``.gitconfig`` file::
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
@@ -31,13 +36,6 @@ Here is an example ``.gitconfig`` file::
31
36
[merge]
32
37
summary = true
33
38
34
- [apply]
35
- whitespace = fix
36
-
37
- [core]
38
- autocrlf = input
39
-
40
-
41
39
You can edit this file directly or you can use the ``git config --global ``
42
40
command::
43
41
69
67
git config --global user.email you@yourdomain.example.com
70
68
71
69
This will write the settings into your git configuration file, which
72
- 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
73
73
74
74
[user]
75
75
name = Your Name
@@ -97,7 +97,9 @@ The following ``git config --global`` commands::
97
97
git config --global alias.wdiff "diff --color-words"
98
98
99
99
will create an ``alias `` section in your ``.gitconfig `` file with contents
100
- like this::
100
+ like this:
101
+
102
+ .. code-block :: none
101
103
102
104
[alias]
103
105
ci = commit -a
@@ -117,7 +119,9 @@ You may also want to make sure that your editor of choice is used ::
117
119
Merging
118
120
-------
119
121
120
- To enforce summaries when doing merges (``~/.gitconfig `` file again)::
122
+ To enforce summaries when doing merges (``~/.gitconfig `` file again):
123
+
124
+ .. code-block :: none
121
125
122
126
[merge]
123
127
log = true
@@ -126,5 +130,43 @@ Or from the command line::
126
130
127
131
git config --global merge.log true
128
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.
129
171
130
172
.. include :: links.inc
0 commit comments