summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-01-11 21:45:56 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-01-11 21:45:56 (GMT)
commit3cdb38519cf9ac94b20b9eba6e4195f7e7674de7 (patch)
tree42532a09924d4b8a7014f909b6bab9f40072f54a
parentdf26d5827b8118c01ef203b5e87833d3d7b7434b (diff)
downloadsite-3cdb38519cf9ac94b20b9eba6e4195f7e7674de7.tar.gz
doc/faq/git.md: Add clarifications regarding index
Clarify the purpose of the staging area, and (try to) improve the "Basic Concepts" section in another few ways.
-rw-r--r--web/input/doc/faq/git.md37
1 files changed, 20 insertions, 17 deletions
diff --git a/web/input/doc/faq/git.md b/web/input/doc/faq/git.md
index 71200c8..53260ec 100644
--- a/web/input/doc/faq/git.md
+++ b/web/input/doc/faq/git.md
@@ -15,23 +15,26 @@ we can’t have a central shared Git repository (and we indeed have one), this
15means distributed development can occur around that central repository. 15means distributed development can occur around that central repository.
16 16
17Git has an additional stage between the working directory and the repository. 17Git has an additional stage between the working directory and the repository.
18When you want to add files or changes, you use 18The idea is that you might be working on multiple unrelated things without
19**git add**. This adds the changes to the repository index, which can be seen 19wanting to commit all changes in one go. Therefore, the changes that should
20as a staging area. When you commit with **git commit**, only the changes in 20be committed must first be added to the repository *index*, which can be seen
21the index are considered. After committing, the changes are still local. To 21as a staging area. This is usually done with **git add**, both for new files
22share it with others, you have to push it to a remote repository, or gave 22*and* for changes to existing ones. When you commit using **git commit**,
23someone pull from your publicly accessible repository (in most case you will 23only the changes in the index are considered.
24still have to push changes there, unless if you were running a git daemon 24
25straight off your working repository). 25After committing, the changes are still local. To share them with others, you
26 26have to push them to a remote repository, or have someone pull from your
27Finally you can’t miss the fact that 27publicly accessible repository (in most cases you will still have to push
28there is no more revision numbers, and the distributed nature of Git is the 28changes there, unless if you were running a git daemon straight off your
29reason for that: there is absolutely no way a single number could be tracked 29working repository).
30in a distributed way. Instead Git uses SHA1 hashes to identify commits (as 30
31well as other objects in the repository). Each branch and tag refer to an 31Finally, you can’t miss the fact that there are no revision numbers, and the
32object name (SHA1 hash), and each commits have one or more parents (commit 32distributed nature of Git is the reason for that: there is absolutely no way a
33objects). Although SHA1 hashes are 40 digits long, with Git you only have to 33single number could be tracked in a distributed way. Instead, Git uses SHA1
34type a handful of digits to reference one. 34hashes to identify commits (as well as other objects in the repository). Each
35branch and tag refer to an object name (SHA1 hash), and each commits have one
36or more parents (commit objects). Although SHA1 hashes are 40 digits long,
37with Git you only have to type a handful of digits to reference one.
35 38
36## Cloning a Project 39## Cloning a Project
37 40