Skip to content

Commit 7c8b16c

Browse files
committed
DOC - added gitwash for nibabel
1 parent 1603369 commit 7c8b16c

21 files changed

+1031
-1
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ pdfdoc: build
114114
cd $(LATEX_DIR) && $(MAKE) all-pdf
115115

116116

117+
gitwash-update: build
118+
cd $(DOCSRC_DIR) && PYTHONPATH=$(CURDIR) $(MAKE) gitwash-update
119+
120+
117121
#
118122
# Website
119123
#

doc/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ help:
2323
@echo " changes to make an overview over all changed/added/deprecated items"
2424
@echo " linkcheck to check all external links for integrity"
2525
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
26+
@echo " gitwash-update update git workflow from source repo"
2627

2728
clean:
2829
-rm -rf $(BUILDROOT)/*
@@ -84,3 +85,7 @@ doctest:
8485
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDROOT)/doctest
8586
@echo "Testing of doctests in the sources finished, look at the " \
8687
"results in _build/doctest/output.txt."
88+
89+
gitwash-update:
90+
python ../tools/gitwash_dumper.py source nibabel --github-user=nipy
91+

doc/source/devguide.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ NiBabel Developer Guidelines
1414
****************************
1515

1616
.. toctree::
17+
:maxdepth: 2
1718

18-
refactoring/index
19+
gitwash/index
20+
refactoring/index
1921

2022
Documentation
2123
=============

doc/source/gitwash/branch_list.png

13 KB
Loading
10.4 KB
Loading

doc/source/gitwash/configure_git.rst

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
.. _configure-git:
2+
3+
===============
4+
Configure git
5+
===============
6+
7+
.. _git-config-basic:
8+
9+
Overview
10+
========
11+
12+
Your personal git_ configurations are saved in the ``.gitconfig`` file in
13+
your home directory.
14+
Here is an example ``.gitconfig`` file::
15+
16+
[user]
17+
name = Your Name
18+
19+
20+
[alias]
21+
ci = commit -a
22+
co = checkout
23+
st = status -a
24+
stat = status -a
25+
br = branch
26+
wdiff = diff --color-words
27+
28+
[core]
29+
editor = vim
30+
31+
[merge]
32+
summary = true
33+
34+
You can edit this file directly or you can use the ``git config --global``
35+
command::
36+
37+
git config --global user.name "Your Name"
38+
git config --global user.email [email protected]
39+
git config --global alias.ci "commit -a"
40+
git config --global alias.co checkout
41+
git config --global alias.st "status -a"
42+
git config --global alias.stat "status -a"
43+
git config --global alias.br branch
44+
git config --global alias.wdiff "diff --color-words"
45+
git config --global core.editor vim
46+
git config --global merge.summary true
47+
48+
To set up on another computer, you can copy your ``~/.gitconfig`` file,
49+
or run the commands above.
50+
51+
In detail
52+
=========
53+
54+
user.name and user.email
55+
------------------------
56+
57+
It is good practice to tell git_ who you are, for labeling any changes
58+
you make to the code. The simplest way to do this is from the command
59+
line::
60+
61+
git config --global user.name "Your Name"
62+
git config --global user.email [email protected]
63+
64+
This will write the settings into your git configuration file, which
65+
should now contain a user section with your name and email::
66+
67+
[user]
68+
name = Your Name
69+
70+
71+
Of course you'll need to replace ``Your Name`` and ``[email protected]``
72+
with your actual name and email address.
73+
74+
Aliases
75+
-------
76+
77+
You might well benefit from some aliases to common commands.
78+
79+
For example, you might well want to be able to shorten ``git checkout``
80+
to ``git co``. Or you may want to alias ``git diff --color-words``
81+
(which gives a nicely formatted output of the diff) to ``git wdiff``
82+
83+
The following ``git config --global`` commands::
84+
85+
git config --global alias.ci "commit -a"
86+
git config --global alias.co checkout
87+
git config --global alias.st "status -a"
88+
git config --global alias.stat "status -a"
89+
git config --global alias.br branch
90+
git config --global alias.wdiff "diff --color-words"
91+
92+
will create an ``alias`` section in your ``.gitconfig`` file with contents
93+
like this::
94+
95+
[alias]
96+
ci = commit -a
97+
co = checkout
98+
st = status -a
99+
stat = status -a
100+
br = branch
101+
wdiff = diff --color-words
102+
103+
Editor
104+
------
105+
106+
You may also want to make sure that your editor of choice is used ::
107+
108+
git config --global core.editor vim
109+
110+
Merging
111+
-------
112+
113+
To enforce summaries when doing merges (``~/.gitconfig`` file again)::
114+
115+
[merge]
116+
log = true
117+
118+
Or from the command line::
119+
120+
git config --global merge.log true
121+
122+
123+
.. include:: git_links.inc

0 commit comments

Comments
 (0)