summaryrefslogtreecommitdiff
path: root/Documentation/git.adoc
AgeCommit message (Collapse)AuthorFilesLines
10 daysMerge branch 'ps/ref-storage-format' into seenJunio C Hamano1-6/+12
The terminology regarding reference storage formats has been unified across command-line options, environment variables, configuration variables, and source code, standardizing on the phrase "ref storage format" (e.g., `--ref-storage-format`, `'GIT_REF_STORAGE_FORMAT'`). Additionally, the `--ref-storage-format` option has been updated to accept payloads in the form `<format>://<payload>`. * ps/ref-storage-format: setup: allow "--ref-storage-format=" to specify a payload setup: rename "init.defaultRefFormat" to "init.defaultRefStorageFormat" t: rename GIT_TEST_DEFAULT_REF_FORMAT setup: rename ref storage format environment variables setup: refactor how we configure the ref storage format refs: expose function to parse reference URIs help: rename "default-ref-format" to "default-ref-storage-format" builtin/rev-parse: rename "--show-ref-format" to "--show-ref-storage-format" builtin/submodule: rename "--ref-format=" to "--ref-storage-format=" builtin/refs: rename "--ref-format=" to "--ref-storage-format=" builtin/clone: rename "--ref-format=" to "--ref-storage-format=" builtin/init: rename "--ref-format=" to "--ref-storage-format=" parse-options: allow for hidden aliases
10 daysMerge branch 'cc/lazy-fetch-trusted-bit' into seenJunio C Hamano1-1/+3
A new 'uploadpack.lazyFetchTrusted' configuration variable has been introduced to allow 'upload-pack' to lazily fetch missing objects from configured promisor remotes when serving trusted repositories. * cc/lazy-fetch-trusted-bit: builtin/upload-pack: set GIT_NO_LAZY_FETCH to 0 on trusted repo promisor-remote: prevent infinite recursion when lazy fetching upload-pack: read uploadpack.lazyFetchTrusted setup: extract path_allowlist_apply() promisor-remote: factor out lazy_fetch_objects()
11 dayssetup: rename ref storage format environment variablesPatrick Steinhardt1-5/+11
With the same reasoning as for git-init(1), rename the environment variables GIT_REFERENCE_BACKEND and GIT_DEFAULT_REF_FORMAT to GIT_REF_STORAGE_FORMAT and GIT_DEFAULT_REF_STORAGE_FORMAT, respectively. The old names are kept as an alias to retain compatibility. While at it, fix indentation for `GIT_REF_STORAGE_FORMAT` docs to use tabs instead of spaces. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 daysbuiltin/init: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt1-1/+1
Back when we gained support for reftables we of course introduced the ability to control the reference storage format that is used by newly created repositories. This infrastructure has grown over time, and unfortunately without consistency: - The command line parameter to specify the ref storage format is called "--ref-format=", while the corresponding repository extension is called "refStorage". - In most cases we refer to the "ref storage format" in our docs, so calling it "--ref-format=" is being inconsistent with them. - It is possible to override the ref storage format via an environment variable that is called "GIT_REFERENCE_BACKEND", which is not even remotely consistent with anything else. - There is also an "object format", but that format does not control how we store objects but rather whether we use SHA1 or SHA256. So in summary, it's a huge mess. This problem is about to become even worse though, as we're soon going to introduce an object storage extension. This extension is the equivalent to the ref storage extension, and of course we also want users to be able to control which object storage format new repositories are using. But we cannot properly name that parameter without creating even more inconsistencies: - "--object-format=" would match "--ref-format=", but that parameter name is already taken to specify the hash function. - "--object-storage=" would be a good fit, but be inconsistent with "--ref-format=". Asking the user to execute `git init --ref-format= --object-storage=` just feels extremely awkward. Instead, this and subsequent patches will fix the mess by consistently referring to the ref storage format as such throughout all options, environment variables and config settings. This new name much more closely indicates that it is about how we store data and finally brings consistency into this area. We will keep the old names working of course for the sake of backwards compatibility. Start with git-init(1). Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 daysbuiltin/upload-pack: set GIT_NO_LAZY_FETCH to 0 on trusted repoChristian Couder1-1/+3
A previous commit added a new "uploadpack.lazyFetchTrusted" protected config variable that can contain an allowlist of repos, as well as functions to check if the current repo is in that list. But when the current repo is in that list, we currently do nothing. Let's instead set `GIT_NO_LAZY_FETCH` to `0`, which allows `upload-pack` and its `pack-objects` child process to lazily fetch the objects they need to serve a client, for example when the filter used by the client and the one used by the server don't match. This allows server operators to properly control lazy fetching. It is their responsibility, not the client's, to decide if the served repo is trusted, as the main security issue is that lazily fetching runs `git fetch`, which may execute arbitrary commands specified in the configuration and hooks of the served repo. As `GIT_NO_LAZY_FETCH` is passed down to child processes through the environment, this works for `pack-objects`, which performs the lazy fetch when serving a client, without any further plumbing. Now that "uploadpack.lazyFetchTrusted" is actually doing something, let's document it and reference it from GIT_NO_LAZY_FETCH's docs. Signed-off-by: Christian Couder <christian.couder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-09-05doc: git: link to the gitdatamodel(7) tutorialKristoffer Haugsbakk1-4/+8
The previous commit added the first mention of gitdatamodel(7) here, under Guides. But there are also other sections where a mention is relevant. Let’s mention it: • under Description, since it is as useful as the other tutorials already mentioned there for those who are interested; • under Terminology, since it complements gitglossary(7) as a pedagogical rather than reference source for the core terms;[1] and • under See Also, since the other tutorials (plus the user manual) are mentioned there. We don’t need to mention it under Further Documentation since we now mention it under Description. † 1: See dee80940 (doc: add an explanation of Git's data model, 2025-11-12): `gitglossary`. This makes a good effort, but it's an alphabetically ordered dictionary and a dictionary is not a good way to learn concepts. You have to jump around too much and it's not possible to present the concepts in the order that they should be explained. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16Merge branch 'os/doc-git-custom-commands'Junio C Hamano1-1/+4
Doc update. * os/doc-git-custom-commands: doc: make it easier to find custom command information
2026-03-12Merge branch 'os/doc-custom-subcommand-on-path'Junio C Hamano1-0/+8
The way end-users can add their own "git <cmd>" subcommand by storing "git-<cmd>" in a directory on their $PATH has not been documented clearly, which has been corrected. * os/doc-custom-subcommand-on-path: doc: add information regarding external commands
2026-03-07doc: make it easier to find custom command informationOmri Sarig1-1/+4
Git supports creating additional commands through aliases, and through placement of executables with a "git-" prefix in the PATH. This information was not easy enough to find - users will look for this information around the command description, but the documentation exists in other locations. Update the "GIT COMMANDS" section to reference the relevant sections, making it easier for to find this information. Signed-off-by: Omri Sarig <omri.sarig13@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-04doc: add information regarding external commandsOmri Sarig1-0/+8
Git supports running external commands in the user's PATH as if they were built-in commands (see execv_dashed_external in git.c). This feature was not fully documented in Git's user-facing documentation. Add a short documentation to describe how PATH is used to find a custom subcommand. Signed-off-by: Omri Sarig <omri.sarig13@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-25refs: add GIT_REFERENCE_BACKEND to specify reference backendKarthik Nayak1-0/+5
Git allows setting a different object directory via 'GIT_OBJECT_DIRECTORY', but provides no equivalent for references. In the previous commit we extended the 'extensions.refStorage' config to also support an URI input for reference backend with location. Let's also add a new environment variable 'GIT_REFERENCE_BACKEND' that takes in the same input as the config variable. Having an environment variable allows us to modify the reference backend and location on the fly for individual Git commands. The environment variable also allows usage of alternate reference directories during 'git-clone(1)' and 'git-init(1)'. Add the config to the repository when created with the environment variable set. When initializing the repository with an alternate reference folder, create the required stubs in the repositories $GIT_DIR. The inverse, i.e. removal of the ref store doesn't clean up the stubs in the $GIT_DIR since that would render it unusable. Removal of ref store is only used when migrating between ref formats and cleanup of the $GIT_DIR doesn't make sense in such a situation. Helped-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-10-02Merge branch 'kh/you-still-use-whatchanged-fix'Junio C Hamano1-1/+2
The "do you still use it?" message given by a command that is deeply deprecated and allow us to suggest alternatives has been updated. * kh/you-still-use-whatchanged-fix: BreakingChanges: remove claim about whatchanged reports whatchanged: remove not-even-shorter clause whatchanged: hint about git-log(1) and aliasing you-still-use-that??: help the user help themselves t0014: test shadowing of aliases for a sample of builtins git: allow alias-shadowing deprecated builtins git: move seen-alias bookkeeping into handle_alias(...) git: add `deprecated` category to --list-cmds Makefile: don’t add whatchanged after it has been removed
2025-09-17git: add `deprecated` category to --list-cmdsKristoffer Haugsbakk1-1/+2
With 145 builtin commands (according to `git --list-cmds=builtins`), users are probably not keeping on top of which ones (if any) are deprecated. Let’s expand the experimental `--list-cmds`[1] to allow users and programs to query for this information. We will also use this in an upcoming commit to implement `is_deprecated_command`. [1]: Using something which is experimental to query for deprecations is perhaps not the most ideal approach, but it is simple to implement and better than having to scan the documentation Acked-by: Patrick Steinhardt <ps@pks.im> Helped-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-25progress: pay attention to (customized) delay timeJohannes Sixt1-1/+1
Using one of the start_delayed_*() functions, clients of the progress API can request that a progress meter is only shown after some time. To do that, the implementation intends to count down the number of seconds stored in struct progress by observing flag progress_update, which the timer interrupt handler sets when a second has elapsed. This works during the first second of the delay. But the code forgets to reset the flag to zero, so that subsequent calls of display_progress() think that another second has elapsed and decrease the count again until zero is reached. Due to the frequency of the calls, this happens without an observable delay in practice, so that the effective delay is always just one second. This bug has been with us since the inception of the feature. Despite having been touched on various occasions, such as 8aade107dd84 (progress: simplify "delayed" progress API), 9c5951cacf5c (progress: drop delay-threshold code), and 44a4693bfcec (progress: create GIT_PROGRESS_DELAY), the short delay went unnoticed. Copy the flag state into a local variable and reset the global flag right away so that we can detect the next clock tick correctly. Since we have not had any complaints that the delay of one second is too short nor that GIT_PROGRESS_DELAY is ignored, people seem to be comfortable with the status quo. Therefore, set the default to 1 to keep the current behavior. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-02-21Merge branch 'jc/doc-boolean-synonyms'Junio C Hamano1-2/+3
Doc updates. * jc/doc-boolean-synonyms: doc: centrally document various ways tospell `true` and `false`
2025-01-21doc: use .adoc extension for AsciiDoc filesbrian m. carlson1-0/+1190
We presently use the ".txt" extension for our AsciiDoc files. While not wrong, most editors do not associate this extension with AsciiDoc, meaning that contributors don't get automatic editor functionality that could be useful, such as syntax highlighting and prose linting. It is much more common to use the ".adoc" extension for AsciiDoc files, since this helps editors automatically detect files and also allows various forges to provide rich (HTML-like) rendering. Let's do that here, renaming all of the files and updating the includes where relevant. Adjust the various build scripts and makefiles to use the new extension as well. Note that this should not result in any user-visible changes to the documentation. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>