From: Junio C Hamano Date: Wed, 27 Feb 2013 18:01:21 +0000 (-0800) Subject: Merge branch 'wk/man-deny-current-branch-is-default-these-days' into maint X-Git-Tag: v1.8.1.5~6 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/28db11169b53695827b180e4ee11c33bf2ec116a?ds=inline;hp=-c Merge branch 'wk/man-deny-current-branch-is-default-these-days' into maint * wk/man-deny-current-branch-is-default-these-days: user-manual: typofix (ofthe->of the) user-manual: Update for receive.denyCurrentBranch=refuse --- 28db11169b53695827b180e4ee11c33bf2ec116a diff --combined Documentation/user-manual.txt index 52c8523c7d,299fc1e3ff..20e5b4216d --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@@ -782,7 -782,7 +782,7 @@@ e05db0fd4f31dde7005f075a84f96b360d05984 Or you could recall that the ... operator selects all commits contained reachable from either one reference or the other but not -both: so +both; so ------------------------------------------------- $ git log origin...master @@@ -931,20 -931,11 +931,20 @@@ The linkgit:git-archive[1] command can any version of a project; for example: ------------------------------------------------- -$ git archive --format=tar --prefix=project/ HEAD | gzip >latest.tar.gz +$ git archive -o latest.tar.gz --prefix=project/ HEAD ------------------------------------------------- -will use HEAD to produce a tar archive in which each filename is -preceded by "project/". +will use HEAD to produce a gzipped tar archive in which each filename +is preceded by `project/`. The output file format is inferred from +the output file extension if possible, see linkgit:git-archive[1] for +details. + +Versions of Git older than 1.7.7 don't know about the 'tar.gz' format, +you'll need to use gzip explicitly: + +------------------------------------------------- +$ git archive --format=tar --prefix=project/ HEAD | gzip >latest.tar.gz +------------------------------------------------- If you're releasing a new version of a software project, you may want to simultaneously make a changelog to include in the release @@@ -1000,16 -991,9 +1000,16 @@@ Developing with gi Telling git your name --------------------- -Before creating any commits, you should introduce yourself to git. The -easiest way to do so is to make sure the following lines appear in a -file named .gitconfig in your home directory: +Before creating any commits, you should introduce yourself to Git. +The easiest way to do so is to use linkgit:git-config[1]: + +------------------------------------------------ +$ git config --global user.name 'Your Name Comes Here' +$ git config --global user.email 'you@yourdomain.example.com' +------------------------------------------------ + +Which will add the following to a file named `.gitconfig` in your +home directory: ------------------------------------------------ [user] @@@ -1017,9 -1001,8 +1017,9 @@@ email = you@yourdomain.example.com ------------------------------------------------ -(See the "CONFIGURATION FILE" section of linkgit:git-config[1] for -details on the configuration file.) +See the "CONFIGURATION FILE" section of linkgit:git-config[1] for +details on the configuration file. The file is plain text, so you can +also edit it with your favorite editor. [[creating-a-new-repository]] @@@ -1578,12 -1561,18 +1578,12 @@@ $ git stash po Ensuring good performance ------------------------- -On large repositories, git depends on compression to keep the history -information from taking up too much space on disk or in memory. - -This compression is not performed automatically. Therefore you -should occasionally run linkgit:git-gc[1]: - -------------------------------------------------- -$ git gc -------------------------------------------------- - -to recompress the archive. This can be very time-consuming, so -you may prefer to run `git gc` when you are not doing other work. +On large repositories, Git depends on compression to keep the history +information from taking up too much space on disk or in memory. Some +git commands may automatically run linkgit:git-gc[1], so you don't +have to worry about running it manually. However, compressing a large +repository may take a while, so you may want to call `gc` explicitly +to avoid automatic compression kicking in when it is not convenient. [[ensuring-reliability]] @@@ -1798,13 -1787,6 +1798,13 @@@ $ git format-patch origi will produce a numbered series of files in the current directory, one for each patch in the current branch but not in origin/HEAD. +`git format-patch` can include an initial "cover letter". You can insert +commentary on individual patches after the three dash line which +`format-patch` places after the commit message but before the patch +itself. If you use `git notes` to track your cover letter material, +`git format-patch --notes` will include the commit's notes in a similar +manner. + You can then import these into your mail client and send them by hand. However, if you have a lot to send at once, you may prefer to use the linkgit:git-send-email[1] script to automate the process. @@@ -1942,11 -1924,11 +1942,11 @@@ linkgit:git-daemon[1] man page for deta examples section.) [[exporting-via-http]] -Exporting a git repository via http +Exporting a git repository via HTTP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The git protocol gives better performance and reliability, but on a -host with a web server set up, http exports may be simpler to set up. +host with a web server set up, HTTP exports may be simpler to set up. All you need to do is place the newly created bare git repository in a directory that is exported by the web server, and make some @@@ -1972,7 -1954,7 +1972,7 @@@ $ git clone http://yourserver.com/~you/ (See also link:howto/setup-git-server-over-http.txt[setup-git-server-over-http] for a slightly more sophisticated setup using WebDAV which also -allows pushing over http.) +allows pushing over HTTP.) [[pushing-changes-to-a-public-repository]] Pushing changes to a public repository @@@ -2004,26 -1986,22 +2004,27 @@@ handling this case Note that the target of a "push" is normally a <> repository. You can also push to a - repository that has a checked-out working tree, but the working tree - will not be updated by the push. This may lead to unexpected results if - the branch you push to is the currently checked-out branch! + repository that has a checked-out working tree, but a push to update the + currently checked-out branch is denied by default to prevent confusion. + See the description of the receive.denyCurrentBranch option + in linkgit:git-config[1] for details. As with `git fetch`, you may also set up configuration options to -save typing; so, for example, after +save typing; so, for example: + +------------------------------------------------- +$ git remote add public-repo ssh://yourserver.com/~you/proj.git +------------------------------------------------- + +adds the following to `.git/config`: ------------------------------------------------- -$ cat >>.git/config <