diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-daemon.txt | 18 | ||||
-rw-r--r-- | Documentation/git-repo-config.txt | 170 | ||||
-rw-r--r-- | Documentation/git-reset.txt | 19 | ||||
-rw-r--r-- | Documentation/git.txt | 3 | ||||
-rw-r--r-- | Documentation/howto/rebase-from-internal-branch.txt | 7 | ||||
-rw-r--r-- | Documentation/howto/update-hook-example.txt | 105 | ||||
-rw-r--r-- | Documentation/pull-fetch-param.txt | 30 | ||||
-rw-r--r-- | Documentation/tutorial.txt | 5 |
8 files changed, 339 insertions, 18 deletions
diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt index 3783858302..2a8f371ec9 100644 --- a/Documentation/git-daemon.txt +++ b/Documentation/git-daemon.txt @@ -8,7 +8,7 @@ git-daemon - A really simple server for git repositories. SYNOPSIS -------- 'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all] - [--timeout=n] [--init-timeout=n] [directory...] + [--timeout=n] [--init-timeout=n] [--strict-paths] [directory...] DESCRIPTION ----------- @@ -29,9 +29,15 @@ This is ideally suited for read-only updates, ie pulling from git repositories. OPTIONS ------- +--strict-paths:: + Match paths exactly (i.e. don't allow "/foo/repo" when the real path is + "/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths. + git-daemon will refuse to start when this option is enabled and no + whitelist is specified. + --export-all:: Allow pulling from all directories that look like GIT repositories - (have the 'objects' subdirectory and a 'HEAD' file), even if they + (have the 'objects' and 'refs' subdirectories), even if they do not have the 'git-daemon-export-ok' file. --inetd:: @@ -57,9 +63,15 @@ OPTIONS --verbose:: Log details about the incoming connections and requested files. +<directory>:: + A directory to add to the whitelist of allowed directories. Unless + --strict-paths is specified this will also include subdirectories + of each named directory. + Author ------ -Written by Linus Torvalds <torvalds@osdl.org> and YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> +Written by Linus Torvalds <torvalds@osdl.org>, YOSHIFUJI Hideaki +<yoshfuji@linux-ipv6.org> and the git-list <git@vger.kernel.org> Documentation -------------- diff --git a/Documentation/git-repo-config.txt b/Documentation/git-repo-config.txt new file mode 100644 index 0000000000..5eefe02437 --- /dev/null +++ b/Documentation/git-repo-config.txt @@ -0,0 +1,170 @@ +git-repo-config(1) +================== + +NAME +---- +git-repo-config - Get and set options in .git/config. + + +SYNOPSIS +-------- +'git-repo-config' name [value [value_regex]] +'git-repo-config' --replace-all name [value [value_regex]] +'git-repo-config' --get name [value_regex] +'git-repo-config' --get-all name [value_regex] +'git-repo-config' --unset name [value_regex] +'git-repo-config' --unset-all name [value_regex] + +DESCRIPTION +----------- +You can query/set/replace/unset options with this command. The name is +actually the section and the key separated by a dot, and the value will be +escaped. + +If you want to set/unset an option which can occor on multiple lines, you +should provide a POSIX regex for the value. If you want to handle the lines +*not* matching the regex, just prepend a single exlamation mark in front +(see EXAMPLES). + +This command will fail if + +. .git/config is invalid, +. .git/config can not be written to, +. no section was provided, +. the section or key is invalid, +. you try to unset an option which does not exist, or +. you try to unset/set an option for which multiple lines match. + + +OPTIONS +------- + +--replace-all:: + Default behaviour is to replace at most one line. This replaces + all lines matching the key (and optionally the value_regex) + +--get:: + Get the value for a given key (optionally filtered by a regex + matching the value). + +--get-all:: + Like get, but does not fail if the number of values for the key + is not exactly one. + +--unset:: + Remove the line matching the key from .git/config. + +--unset-all:: + Remove all matching lines from .git/config. + + +EXAMPLE +------- + +Given a .git/config like this: + + # + # This is the config file, and + # a '#' or ';' character indicates + # a comment + # + + ; core variables + [core] + ; Don't trust file modes + filemode = false + + ; Our diff algorithm + [diff] + external = "/usr/local/bin/gnu-diff -u" + renames = true + + ; Proxy settings + [proxy] + command="ssh" for "ssh://kernel.org/" + command="proxy-command" for kernel.org + command="myprotocol-command" for "my://" + command=default-proxy ; for all the rest + +you can set the filemode to true with + +------------ +% git repo-config core.filemode true +------------ + +The hypothetic proxy command entries actually have a postfix to discern +to what URL they apply. Here is how to change the entry for kernel.org +to "ssh". + +------------ +% git repo-config proxy.command '"ssh" for kernel.org' 'for kernel.org$' +------------ + +This makes sure that only the key/value pair for kernel.org is replaced. + +To delete the entry for renames, do + +------------ +% git repo-config --unset diff.renames +------------ + +If you want to delete an entry for a multivar (like proxy.command above), +you have to provide a regex matching the value of exactly one line. + +To query the value for a given key, do + +------------ +% git repo-config --get core.filemode +------------ + +or + +------------ +% git repo-config core.filemode +------------ + +or, to query a multivar: + +------------ +% git repo-config --get proxy.command "for kernel.org$" +------------ + +If you want to know all the values for a multivar, do: + +------------ +% git repo-config --get-all proxy.command +------------ + +If you like to live dangerous, you can replace *all* proxy.commands by a +new one with + +------------ +% git repo-config --replace-all proxy.command ssh +------------ + +However, if you really only want to replace the line for the default proxy, +i.e. the one without a "for ..." postfix, do something like this: + +------------ +% git repo-config proxy.command ssh '! for ' +------------ + +To actually match only values with an exclamation mark, you have to + +------------ +% git repo-config section.key value '[!]' +------------ + + +Author +------ +Written by Johannes Schindelin <Johannes.Schindelin@gmx.de> + +Documentation +-------------- +Documentation by Johannes Schindelin. + +GIT +--- +Part of the gitlink:git[7] suite + diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index 31ec2076e7..6af3a4fdb9 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -14,19 +14,30 @@ DESCRIPTION Sets the current head to the specified commit and optionally resets the index and working tree to match. +This command is useful if you notice some small error in a recent +commit (or set of commits) and want to redo that part without showing +the undo in the history. + +If you want to undo a commit other than the latest on a branch, +gitlink:git-revert[1] is your friend. + OPTIONS ------- --mixed:: - Like --soft but reports what has not been updated. This is the - default action. + Resets the index but not the working tree (ie, the changed files + are preserved but not marked for commit) and reports what has not + been updated. This is the default action. --soft:: Does not touch the index file nor the working tree at all, but - requires them in a good order. + requires them to be in a good order. This leaves all your changed + files "Updated but not checked in", as gitlink:git-status[1] would + put it. --hard:: Matches the working tree and index to that of the tree being - switched to. + switched to. Any changes to tracked files in the working tree + since <commit-ish> are lost. <commit-ish>:: Commit to make the current HEAD. diff --git a/Documentation/git.txt b/Documentation/git.txt index 338e5acb8b..a518249863 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -108,6 +108,9 @@ gitlink:git-prune-packed[1]:: gitlink:git-read-tree[1]:: Reads tree information into the directory index +gitlink:git-repo-config[1]:: + Get and set options in .git/config. + gitlink:git-unpack-objects[1]:: Unpacks objects out of a packed archive. diff --git a/Documentation/howto/rebase-from-internal-branch.txt b/Documentation/howto/rebase-from-internal-branch.txt index b2c021d917..c2d4a91c7c 100644 --- a/Documentation/howto/rebase-from-internal-branch.txt +++ b/Documentation/howto/rebase-from-internal-branch.txt @@ -40,10 +40,7 @@ So I started from master, made a bunch of edits, and committed: $ git checkout master $ cd Documentation; ed git.txt ... $ cd ..; git add Documentation/*.txt - $ git commit -s -v - -NOTE. The -v flag to commit is a handy way to make sure that -your additions are not introducing bogusly formatted lines. + $ git commit -s After the commit, the ancestry graph would look like this: @@ -98,7 +95,7 @@ to do cherrypicking using only the core GIT tools. Let's go back to the earlier picture, with different labels. You, as an individual developer, cloned upstream repository and -amde a couple of commits on top of it. +made a couple of commits on top of it. *your "master" head upstream --> #1 --> #2 --> #3 diff --git a/Documentation/howto/update-hook-example.txt b/Documentation/howto/update-hook-example.txt new file mode 100644 index 0000000000..dacaf17c2e --- /dev/null +++ b/Documentation/howto/update-hook-example.txt @@ -0,0 +1,105 @@ +From: Junio C Hamano <junkio@cox.net> +Subject: control access to branches. +Date: Thu, 17 Nov 2005 23:55:32 -0800 +Message-ID: <7vfypumlu3.fsf@assigned-by-dhcp.cox.net> +Abstract: An example hooks/update script is presented to + implement repository maintenance policies, such as who can push + into which branch and who can make a tag. + +When your developer runs git-push into the repository, +git-receive-pack is run (either locally or over ssh) as that +developer, so is hooks/update script. Quoting from the relevant +section of the documentation: + + Before each ref is updated, if $GIT_DIR/hooks/update file exists + and executable, it is called with three parameters: + + $GIT_DIR/hooks/update refname sha1-old sha1-new + + The refname parameter is relative to $GIT_DIR; e.g. for the + master head this is "refs/heads/master". Two sha1 are the + object names for the refname before and after the update. Note + that the hook is called before the refname is updated, so either + sha1-old is 0{40} (meaning there is no such ref yet), or it + should match what is recorded in refname. + +So if your policy is (1) always require fast-forward push +(i.e. never allow "git-push repo +branch:branch"), (2) you +have a list of users allowed to update each branch, and (3) you +do not let tags to be overwritten, then: + + #!/bin/sh + # This is a sample hooks/update script, written by JC + # in his e-mail buffer, so naturally it is not tested + # but hopefully would convey the idea. + + umask 002 + case "$1" in + refs/tags/*) + # No overwriting an existing tag + if test -f "$GIT_DIR/$1" + then + exit 1 + fi + ;; + refs/heads/*) + # No rebasing or rewinding + if expr "$2" : '0*$' >/dev/null + then + # creating a new branch + ; + else + # updating -- make sure it is a fast forward + mb=`git-merge-base "$2" "$3"` + case "$mb,$2" in + "$2,$mb") + ;; # fast forward -- happy + *) + exit 1 ;; # unhappy + esac + fi + ;; + *) + # No funny refs allowed + exit 1 + ;; + esac + + # Is the user allowed to update it? + me=`id -u -n` ;# e.g. "junio" + while read head_pattern users + do + if expr "$1" : "$head_pattern" >/dev/null + then + case " $users " in + *" $me "*) + exit 0 ;; # happy + ' * ') + exit 0 ;; # anybody + esac + fi + done + exit 1 + +For the sake of simplicity, I assumed that you keep something +like this in $GIT_DIR/info/allowed-pushers file: + + refs/heads/master junio + refs/heads/cogito$ pasky + refs/heads/bw/ linus + refs/heads/tmp/ * + refs/tags/v[0-9]* junio + +With this, Linus can push or create "bw/penguin" or "bw/zebra" +or "bw/panda" branches, Pasky can do only "cogito", and I can do +master branch and make versioned tags. And anybody can do +tmp/blah branches. This assumes all the users are in a single +group that can write into $GIT_DIR/ and underneath. + + + + + + + + diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index ddd5823df7..6413d525ce 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -5,11 +5,31 @@ to name the remote repository: + =============================================================== -- Rsync URL: rsync://remote.machine/path/to/repo.git/ -- HTTP(s) URL: http://remote.machine/path/to/repo.git/ -- git URL: git://remote.machine/path/to/repo.git/ -- ssh URL: remote.machine:/path/to/repo.git/ -- Local directory: /path/to/repo.git/ +- rsync://host.xz/path/to/repo.git/ +- http://host.xz/path/to/repo.git/ +- https://host.xz/path/to/repo.git/ +- git://host.xz/path/to/repo.git/ +- git://host.xz/~user/path/to/repo.git/ +- ssh://host.xz/path/to/repo.git/ +- ssh://host.xz/~user/path/to/repo.git/ +- ssh://host.xz/~/path/to/repo.git +=============================================================== ++ + SSH Is the default transport protocol and also supports an + scp-like syntax. Both syntaxes support username expansion, + as does the native git protocol. The following three are + identical to the last three above, respectively: ++ +=============================================================== +- host.xz:/path/to/repo.git/ +- host.xz:~user/path/to/repo.git/ +- host.xz:path/to/repo.git +=============================================================== ++ + To sync with a local directory, use: + +=============================================================== +- /path/to/repo.git/ =============================================================== + In addition to the above, as a short-hand, the name of a diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt index 03eb4216f3..e2dfb00ab1 100644 --- a/Documentation/tutorial.txt +++ b/Documentation/tutorial.txt @@ -1534,7 +1534,10 @@ on that project and has an own "public repository" goes like this: the "project lead" person does. 3. Copy over the packed files from "project lead" public - repository to your public repository. + repository to your public repository, unless the "project + lead" repository lives on the same machine as yours. In the + latter case, you can use `objects/info/alternates` file to + point at the repository you are borrowing from. 4. Push into the public repository from your primary repository. Run `git repack`, and possibly `git prune` if the |