@matheusbsbs / matheus-bagliano / commits / c64415e29e
Fork 0

user-manual: miscellaneous editing

I cherry-picked some additional miscellaneous fixes from those suggested by Santi Béjar, including fixes to: - correct discussion of repository/HEAD->repository shortcut - add mention of git-mergetool - add mention of --track - mention "-f" as well as "+" for fetch Cc: Santi Béjar <sbejar@gmail.com> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>

J. Bruce Fields committed May 7, 2007 at 00:56 UTC c64415e29ecf8e26dc2c4451f9a04023dd941ac7
1 file changed +47 -35
Documentation/user-manual.txt
+47 -35
@@ -57,7 +57,7 @@ Managing branches
57 -----------------
58
59 -----------------------------------------------
60 -$ git branch # list all branches in this repo
60 +$ git branch # list all local branches in this repo
61 $ git checkout test # switch working directory to branch "test"
62 $ git branch new # create branch "new" starting at current HEAD
63 $ git branch -d new # delete branch "new"
@@ -496,8 +496,8 @@ git branch <branch> <start-point>::
496 including using a branch name or a tag name
497 git branch -d <branch>::
498 delete the branch <branch>; if the branch you are deleting
499 - points to a commit which is not reachable from this branch,
500 - this command will fail with a warning.
499 + points to a commit which is not reachable from the current
500 + branch, this command will fail with a warning.
501 git branch -D <branch>::
502 even if the branch points to a commit not reachable
503 from the current branch, you may know that that commit
@@ -602,13 +602,9 @@ shorthand:
602 The full name is occasionally useful if, for example, there ever
603 exists a tag and a branch with the same name.
604
605 -As another useful shortcut, if the repository "origin" posesses only
606 -a single branch, you can refer to that branch as just "origin".
607 -
608 -More generally, if you have defined a remote repository named
609 -"example", you can refer to the branch in that repository as
610 -"example". And for a repository with multiple branches, this will
611 -refer to the branch designated as the "HEAD" branch.
605 +As another useful shortcut, the "HEAD" of a repository can be referred
606 +to just using the name of that repository. So, for example, "origin"
607 +is usually a shortcut for the HEAD branch in the repository "origin".
608
609 For the complete list of paths which git checks for references, and
610 the order it uses to decide which to choose when there are multiple
@@ -832,10 +828,10 @@ $ git tag stable-1 1b2e1d63ff
828
829 You can use stable-1 to refer to the commit 1b2e1d63ff.
830
835 -This creates a "lightweight" tag. If the tag is a tag you wish to
836 -share with others, and possibly sign cryptographically, then you
837 -should create a tag object instead; see the gitlink:git-tag[1] man
838 -page for details.
831 +This creates a "lightweight" tag. If you would also like to include a
832 +comment with the tag, and possibly sign it cryptographically, then you
833 +should create a tag object instead; see the gitlink:git-tag[1] man page
834 +for details.
835
836 [[browsing-revisions]]
837 Browsing revisions
@@ -1176,6 +1172,8 @@ $ git diff --cached # difference between HEAD and the index; what
1172 $ git diff # difference between the index file and your
1173 # working directory; changes that would not
1174 # be included if you ran "commit" now.
1175 +$ git diff HEAD # difference between HEAD and working tree; what
1176 + # would be committed if you ran "commit -a" now.
1177 $ git status # a brief per-file summary of the above.
1178 -------------------------------------------------
1179
@@ -1223,8 +1221,6 @@ If you examine the resulting commit using gitk, you will see that it
1221 has two parents, one pointing to the top of the current branch, and
1222 one to the top of the other branch.
1223
1226 -In more detail:
1227 -
1224 [[resolving-a-merge]]
1225 Resolving a merge
1226 -----------------
@@ -1361,6 +1357,9 @@ $ gitk --merge
1357 These will display all commits which exist only on HEAD or on
1358 MERGE_HEAD, and which touch an unmerged file.
1359
1360 +You may also use gitlink:git-mergetool, which lets you merge the
1361 +unmerged files using external tools such as emacs or kdiff3.
1362 +
1363 Each time you resolve the conflicts in a file and update the index:
1364
1365 -------------------------------------------------
@@ -1705,9 +1704,16 @@ so often you can accomplish the above with just
1704 $ git pull
1705 -------------------------------------------------
1706
1708 -See the descriptions of the branch.<name>.remote and
1709 -branch.<name>.merge options in gitlink:git-config[1] to learn
1710 -how to control these defaults depending on the current branch.
1707 +See the descriptions of the branch.<name>.remote and branch.<name>.merge
1708 +options in gitlink:git-config[1] to learn how to control these defaults
1709 +depending on the current branch. Also note that the --track option to
1710 +gitlink:git-branch[1] and gitlink:git-checkout[1] can be used to
1711 +automatically set the default remote branch to pull from at the time
1712 +that a branch is created:
1713 +
1714 +-------------------------------------------------
1715 +$ git checkout --track -b origin/maint maint
1716 +-------------------------------------------------
1717
1718 In addition to saving you keystrokes, "git pull" also helps you by
1719 producing a default commit message documenting the branch and
@@ -1830,14 +1836,14 @@ Now, assume your personal repository is in the directory ~/proj. We
1836 first create a new clone of the repository:
1837
1838 -------------------------------------------------
1833 -$ git clone --bare proj-clone.git
1839 +$ git clone --bare proj.git
1840 -------------------------------------------------
1841
1836 -The resulting directory proj-clone.git will contains a "bare" git
1842 +The resulting directory proj.git will contains a "bare" git
1843 repository--it is just the contents of the ".git" directory, without
1844 a checked-out copy of a working directory.
1845
1840 -Next, copy proj-clone.git to the server where you plan to host the
1846 +Next, copy proj.git to the server where you plan to host the
1847 public repository. You can use scp, rsync, or whatever is most
1848 convenient.
1849
@@ -1863,7 +1869,7 @@ adjustments to give web clients some extra information they need:
1869 -------------------------------------------------
1870 $ mv proj.git /home/you/public_html/proj.git
1871 $ cd proj.git
1866 -$ git update-server-info
1872 +$ git --bare update-server-info
1873 $ chmod a+x hooks/post-update
1874 -------------------------------------------------
1875
@@ -1930,7 +1936,7 @@ As with git-fetch, you may also set up configuration options to
1936 save typing; so, for example, after
1937
1938 -------------------------------------------------
1933 -$ cat >.git/config <<EOF
1939 +$ cat >>.git/config <<EOF
1940 [remote "public-repo"]
1941 url = ssh://yourserver.com/~you/proj.git
1942 EOF
@@ -2312,9 +2318,15 @@ descendant of the old head, you may force the update with:
2318 $ git fetch git://example.com/proj.git +master:refs/remotes/example/master
2319 -------------------------------------------------
2320
2315 -Note the addition of the "+" sign. Be aware that commits that the
2316 -old version of example/master pointed at may be lost, as we saw in
2317 -the previous section.
2321 +Note the addition of the "+" sign. Alternatively, you can use the "-f"
2322 +flag to force updates of all the fetched branches, as in:
2323 +
2324 +-------------------------------------------------
2325 +$ git fetch -f origin
2326 +-------------------------------------------------
2327 +
2328 +Be aware that commits that the old version of example/master pointed at
2329 +may be lost, as we saw in the previous section.
2330
2331 [[remote-branch-configuration]]
2332 Configuring remote branches
@@ -2400,7 +2412,7 @@ approximated by the SHA1 hash of the object itself. Objects may refer
2412 to other objects (by referencing their SHA1 hash), and so you can
2413 build up a hierarchy of objects.
2414
2403 -All objects have a statically determined "type" aka "tag", which is
2415 +All objects have a statically determined "type" which is
2416 determined at object creation time, and which identifies the format of
2417 the object (i.e. how it is used, and how it can refer to other
2418 objects). There are currently four different object types: "blob",
@@ -2423,7 +2435,7 @@ the time of the commit). In addition, a "commit" refers to one or more
2435 that directory hierarchy.
2436
2437 As a special case, a commit object with no parents is called the "root"
2426 -object, and is the point of an initial project commit. Each project
2438 +commit, and is the point of an initial project commit. Each project
2439 must have at least one root, and while you can tie several different
2440 root objects together into one project by creating a commit object which
2441 has two or more separate roots as its ultimate parents, that's probably
@@ -2542,7 +2554,7 @@ that the tree is "good" or that the merge information makes sense.
2554 The parents do not have to actually have any relationship with the
2555 result, for example.
2556
2545 -Note on commits: unlike real SCM's, commits do not contain
2557 +Note on commits: unlike some SCM's, commits do not contain
2558 rename information or file mode change information. All of that is
2559 implicit in the trees involved (the result tree, and the result trees
2560 of the parents), and describing that makes no sense in this idiotic
@@ -2609,7 +2621,7 @@ The "index" aka "Current Directory Cache"
2621 -----------------------------------------
2622
2623 The index is a simple binary file, which contains an efficient
2612 -representation of a virtual directory content at some random time. It
2624 +representation of the contents of a virtual directory. It
2625 does so by a simple array that associates a set of names, dates,
2626 permissions and content (aka "blob") objects together. The cache is
2627 always kept ordered by name, and names are unique (with a few very
@@ -2912,7 +2924,7 @@ since the tree object information is always the first line in a commit
2924 object.
2925
2926 Once you know the three trees you are going to merge (the one "original"
2915 -tree, aka the common case, and the two "result" trees, aka the branches
2927 +tree, aka the common tree, and the two "result" trees, aka the branches
2928 you want to merge), you do a "merge" read into the index. This will
2929 complain if it has to throw away your old index contents, so you should
2930 make sure that you've committed those - in fact you would normally
@@ -2966,14 +2978,14 @@ obviously the final outcome is what is in `HEAD`. What the
2978 above example shows is that file `hello.c` was changed from
2979 `$orig` to `HEAD` and `$orig` to `$target` in a different way.
2980 You could resolve this by running your favorite 3-way merge
2969 -program, e.g. `diff3` or `merge`, on the blob objects from
2970 -these three stages yourself, like this:
2981 +program, e.g. `diff3`, `merge`, or git's own merge-file, on
2982 +the blob objects from these three stages yourself, like this:
2983
2984 ------------------------------------------------
2985 $ git-cat-file blob 263414f... >hello.c~1
2986 $ git-cat-file blob 06fa6a2... >hello.c~2
2987 $ git-cat-file blob cc44c73... >hello.c~3
2976 -$ merge hello.c~2 hello.c~1 hello.c~3
2988 +$ git merge-file hello.c~2 hello.c~1 hello.c~3
2989 ------------------------------------------------
2990
2991 This would leave the merge result in `hello.c~2` file, along