@@ -31,9 +31,9 @@ file in your home directory. Here is an example:
31
31
You can edit this file directly or you can use Git to make changes for
32
32
you::
33
33
34
- [alice@localhost ~] git config --global user.name "Alice Adventure"
35
- [alice@localhost ~] git config --global user.email [email protected]
36
- [alice@localhost ~] git config --global core.editor vim
34
+ [alice@localhost ~]$ git config --global user.name "Alice Adventure"
35
+ [alice@localhost ~]$ git config --global user.email [email protected]
36
+ [alice@localhost ~]$ git config --global core.editor vim
37
37
38
38
39
39
Aliases
@@ -44,12 +44,12 @@ might want to be able to shorten ``git checkout`` to ``git co``. Or
44
44
you may want to alias ``git diff --color-words `` (which gives a nicely
45
45
formatted output of the diff) to ``git wdiff ``. You can do this with::
46
46
47
- [alice@localhost ~] git config --global alias.ci "commit -a"
48
- [alice@localhost ~] git config --global alias.co checkout
49
- [alice@localhost ~] git config --global alias.st "status -a"
50
- [alice@localhost ~] git config --global alias.stat "status -a"
51
- [alice@localhost ~] git config --global alias.br branch
52
- [alice@localhost ~] git config --global alias.wdiff "diff --color-words"
47
+ [alice@localhost ~]$ git config --global alias.ci "commit -a"
48
+ [alice@localhost ~]$ git config --global alias.co checkout
49
+ [alice@localhost ~]$ git config --global alias.st "status -a"
50
+ [alice@localhost ~]$ git config --global alias.stat "status -a"
51
+ [alice@localhost ~]$ git config --global alias.br branch
52
+ [alice@localhost ~]$ git config --global alias.wdiff "diff --color-words"
53
53
54
54
The above commands will create an ``alias `` section in your ``.gitconfig ``
55
55
file with contents like this:
70
70
71
71
To set the editor to use for editing commit messages, you can use::
72
72
73
- [alice@localhost ~] git config --global core.editor vim
73
+ [alice@localhost ~]$ git config --global core.editor vim
74
74
75
75
or set the ``EDITOR `` environment variable.
76
76
@@ -87,7 +87,7 @@ To enforce summaries when doing merges (``~/.gitconfig`` file again):
87
87
88
88
Or from the command line::
89
89
90
- [alice@localhost ~] git config --global merge.log true
90
+ [alice@localhost ~]$ git config --global merge.log true
91
91
92
92
93
93
.. _section-fancy-log :
@@ -104,7 +104,7 @@ Here is an alias to get a fancy log output. It should go in the
104
104
105
105
Using this ``lg `` alias gives you the changelog with a colored ASCII graph::
106
106
107
- [alice@localhost ~] git lg
107
+ [alice@localhost ~]$ git lg
108
108
* 6d8e1ee - (HEAD, origin/my-fancy-feature, my-fancy-feature) NF - a fancy file (45 minutes ago) [Matthew Brett]
109
109
* d304a73 - (origin/placeholder, placeholder) Merge pull request #48 from hhuuggoo/master (2 weeks ago) [Jonathan Terhorst]
110
110
|\
@@ -133,10 +133,8 @@ There are many, many tutorials and command summaries available online.
133
133
Beginner
134
134
--------
135
135
136
- * `Try Git <https://try.github.io/levels/1/challenges/1 >`_ is an entry-level
137
- tutorial you can do in your browser. If you are unfamiliar with revision
138
- control, you will want to pay close attention to the "Advice" section toward
139
- the bottom.
136
+ * `gittutorial <https://git-scm.com/docs/gittutorial >`_ is a introductory tutorial
137
+ from Git project.
140
138
141
139
* `Git magic
142
140
<http://www-cs-students.stanford.edu/~blynn/gitmagic/index.html> `_
@@ -146,10 +144,6 @@ Beginner
146
144
<http://tom.preston-werner.com/2009/05/19/the-git-parable.html> `_ is
147
145
an easy read explaining the concepts behind Git.
148
146
149
- * `Git foundation
150
- <http://matthew-brett.github.com/pydagogue/foundation.html> `_
151
- expands on the `Git parable `_.
152
-
153
147
* Although it also contains more advanced material about branches and
154
148
detached head and the like, the visual summaries of merging and branches
155
149
in `Learn Git Branching <http://pcottle.github.io/learnGitBranching/ >`_
@@ -159,39 +153,20 @@ Beginner
159
153
Advanced
160
154
--------
161
155
162
- * `Github help <http://help.github.com >`_ has an excellent series of
156
+ * `GitHub help <http://help.github.com >`_ has an excellent series of
163
157
how-to guides.
164
158
165
159
* The `pro Git book <http://git-scm.com/book >`_ is a good in-depth book on Git.
166
160
167
- * `Github Training <http://training.github.com >`_ has an excellent series
161
+ * `Github Training Kit <http://training.github.com >`_ has an excellent series
168
162
of tutorials as well as videos and screencasts.
169
163
170
- * The `Git tutorial <http://schacon.github.com/git/gittutorial.html >`_.
171
-
172
164
* `Git ready <http://www.gitready.com/ >`_ is a nice series of
173
165
tutorials.
174
166
175
- * `Fernando Perez' Git page
176
- <http://www.fperez.org/py4science/git.html> `_ contains many links
177
- and tips.
178
-
179
167
* A good but technical page on `Git concepts
180
168
<http://www.eecs.harvard.edu/~cduan/technical/git/> `_
181
169
182
- * `Git svn crash course <http://git-scm.com/course/svn.html >`_: Git
183
- for those of us used to `subversion
184
- <http://subversion.tigris.org/> `_
185
-
186
-
187
- Summaries/cheat sheets
188
- ----------------------
189
- * A `Git cheat sheet <http://github.com/guides/git-cheat-sheet >`_ is a
190
- page giving summaries of common commands.
191
-
192
- * The `Git user manual
193
- <http://schacon.github.com/git/user-manual.html> `_.
194
-
195
170
196
171
Git best practices
197
172
==================
@@ -200,9 +175,9 @@ There are many ways of working with Git. Here are some posts on the
200
175
rules of thumb that other projects have come up with:
201
176
202
177
* Linus Torvalds on `Git management
203
- <https://web.archive.org/web/20120511084711/http://kerneltrap.org/Linux/Git_Management> `_
178
+ <https://web.archive.org/web/20120511084711/http://kerneltrap.org/Linux/Git_Management> `_.
204
179
205
- * Linus Torvalds on `linux Git workflow
180
+ * Linus Torvalds on `Git workflow
206
181
<http://www.mail-archive.com/[email protected] /msg39091.html> `_. Summary:
207
182
use the Git tools to make the history of your edits as clean as
208
183
possible; merge from upstream edits as little as possible in
@@ -216,16 +191,16 @@ You can get these on your own machine with (e.g) ``git help push`` or
216
191
(same thing) ``git push --help ``, but, for convenience, here are the
217
192
online manual pages for some common commands:
218
193
219
- * `git add <http ://schacon.github. com/git /git-add.html >`_
220
- * `git branch <http ://schacon.github. com/git /git-branch.html >`_
221
- * `git checkout <http ://schacon.github. com/git /git-checkout.html >`_
222
- * `git clone <http ://schacon.github. com/git /git-clone.html >`_
223
- * `git commit <http ://schacon.github. com/git /git-commit.html >`_
224
- * `git config <http ://schacon.github. com/git /git-config.html >`_
225
- * `git diff <http ://schacon.github. com/git /git-diff.html >`_
226
- * `git log <http ://schacon.github. com/git /git-log.html >`_
227
- * `git pull <http ://schacon.github. com/git /git-pull.html >`_
228
- * `git push <http ://schacon.github. com/git /git-push.html >`_
229
- * `git remote <http ://schacon.github. com/git /git-remote.html >`_
230
- * `git status <http ://schacon.github. com/git /git-status.html >`_
194
+ * `git add <https ://git-scm. com/docs /git-add >`_
195
+ * `git branch <https ://git-scm. com/docs /git-branch.html >`_
196
+ * `git checkout <https ://git-scm. com/docs /git-checkout.html >`_
197
+ * `git clone <https ://git-scm. com/docs /git-clone.html >`_
198
+ * `git commit <https ://git-scm. com/docs /git-commit.html >`_
199
+ * `git config <https ://git-scm. com/docs /git-config.html >`_
200
+ * `git diff <https ://git-scm. com/docs /git-diff.html >`_
201
+ * `git log <https ://git-scm. com/docs /git-log.html >`_
202
+ * `git pull <https ://git-scm. com/docs /git-pull.html >`_
203
+ * `git push <https ://git-scm. com/docs /git-push.html >`_
204
+ * `git remote <https ://git-scm. com/docs /git-remote.html >`_
205
+ * `git status <https ://git-scm. com/docs /git-status.html >`_
231
206
0 commit comments