FAQ for common user questions
v2 cover FAQ for common user questions
Git is an enormously flexible and powerful piece of software, but many people find it confusing and hard to use. This patch introduces a FAQ to address some common user questions and hopefully make it easier.
I know there are some plans to add additional entries to this. I propose we tack them on as additional patches, and if I need to reroll this again, I can pick them up as part of the series, unless someone has strong opinions about doing things differently.
Changes from v1:
* Fix various indentation issues.
* Avoid using "some people", except to state that "some people find vi difficult to use", preferring to use language addressing misconceptions more directly.
* Add "erroneously" to "This is often suggested" to avoid users accidentally doing what we recommend against.
* Attempt to come up with a better way to describe a personal name, using Junio as an example.
brian m. carlson (1):
docs: add a FAQ
Documentation/Makefile | 1 + Documentation/gitfaq.txt | 337 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 338 insertions(+) create mode 100644 Documentation/gitfaq.txt
PATCH v2 1/1 docs: add a FAQ
Git is an enormously flexible and powerful piece of software. However, it can be intimidating for many users and there are a set of common questions that users often ask. While we already have some new user documentation, it's worth adding a FAQ to address common questions that users often have. Even though some of this is addressed elsewhere in the documentation, experience has shown that it is difficult for users to find, so a centralized location is helpful.
Add such a FAQ and fill it with some common questions and answers. While there are few entries now, we can expand it in the future to cover more things as we find new questions that users have. Let's also add section markers so that people answering questions can directly link users to the proper answer.
The FAQ also addresses common configuration questions that apply not only to Git as an independent piece of software but also the ecosystem of CI tools and hosting providers that people use, since these are the source of common questions. An attempt has been made to avoid mentioning any particular provider or tool, but to nevertheless cover common configurations that apply to a wide variety of such tools.
Note that the long lines for certain questions are required, since Asciidoctor does not permit broken lines there.
--- Documentation/Makefile | 1 + Documentation/gitfaq.txt | 338 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 339 insertions(+) create mode 100644 Documentation/gitfaq.txt
Documentation/Makefile +1 -0
@@ -30,6 +30,7 @@ MAN7_TXT += gitcredentials.txt MAN7_TXT += gitcvs-migration.txt MAN7_TXT += gitdiffcore.txt MAN7_TXT += giteveryday.txt +MAN7_TXT += gitfaq.txt MAN7_TXT += gitglossary.txt MAN7_TXT += gitnamespaces.txt MAN7_TXT += gitremote-helpers.txt
Documentation/gitfaq.txt new file +338 -0
338 lines not on this page · raw message
Re: [PATCH v2] docs: add a FAQ
Quoted 3 lines · brian m. carlson
Note that the long lines for certain questions are required, since Asciidoctor does not permit broken lines there.
---
Missing sign-off.
[Snipping lots of very well-written Q&As...]
Documentation/gitfaq.txt line 108
Quoted 4 lines
Documentation/gitfaq.txt new file +4
-0+You can also just enter your password when prompted, or you can place the +password (which must be percent-encoded) in the URL. The latter option is not +particularly secure and can lead to accidental exposure of credentials, so it is +not recommended.
So should we even mention it? Or should we use the "it is sometimes (erroneously) suggested" construct?
Quoted 5 lines
+[[multiple-accounts-ssh]]
Documentation/gitfaq.txt new file +4
-0+How do I use multiple accounts with the same hosting provider using SSH?:: + With most hosting providers that support SSH, a single key pair uniquely + identifies a user. Therefore, to use multiple accounts, it's necessary + to create a key pair for each account. If you're using a reasonably
Documentation/gitfaq.txt line 165
Quoted 10 lines
Documentation/gitfaq.txt new file +10
-0+ modern OpenSSH version, you can create a new key pair with something + like `ssh-keygen -t ed25519 -f ~/.ssh/id_committer`. You can then + register the public key (in this case, `~/.ssh/id_committer.pub`; note + the `.pub`) with the hosting provider. ++ +Most hosting providers use a single SSH account for pushing; that is, all users +push to the `git` account (e.g., `[email protected]`). If that's the case for +your provider, you can set up multiple aliases in SSH to make it clear which key +pair to use. For example, you could write something like the following, +substituting the proper private key file:
Would this be in ~/.ssh/config?
Documentation/gitfaq.txt line 175
Quoted 10 lines
++
+----Documentation/gitfaq.txt new file +8
-0+# This is the account for author on git.example.org. +Host example_author + HostName git.example.org + User git + # This is the key pair registered for author with git.example.org. + IdentityFile ~/.ssh/id_author + IdentitiesOnly yes +# This is the committer for author on git.example.org.
Looks like you did s/account/committer/ instead of s/author/committer/?
Documentation/gitfaq.txt line 194
Quoted 13 lines
Documentation/gitfaq.txt new file +12
-0+Host example_committer + HostName git.example.org + User git + # This is the key pair registered for committer with git.example.org. + IdentityFile ~/.ssh/id_committer + IdentitiesOnly yes +---- + +[[last-commit-amend]] +I've made a mistake in the last commit. How do I change it?:: + You can make the appropriate change to your working tree, run `git add + <file>` or `git rm <file>`, as approrpiate, to stage it, and then `git
typoed "appropriate"
Quoted 2 lines
+[[restrict-with-hooks]]
+How do I prevent users from making certain changes with hooks?::
I read this as:
How do I prevent users from making "certain changes with hooks"?
As opposed to your intended meaning:
How do I (with hooks) prevent users from making certain changes?
I'm not suggesting the latter as a "fix" for this "problem" though, since it's a bit clumsy. How about adding a comma:
How do I prevent users from making certain changes, with hooks?
Or maybe just dropping those last two words.
Please trust your judgement on whether this is a problem, and if so, how to go about addressing it -- I know you have lots of such judgement.
Quoted 2 lines
+Cross-Platform Issues
+~~~~~~~~~~~~~~~~~~~~~
I think you meant to use "--" as everywhere else instead of "~~". This is not a subsection of "Hooks".
Quoted 1 line
+To do so, you can specify a linkgit:gitattributes[5] pattern with with the
"with with"
Documentation/gitfaq.txt line 284
Quoted 8 lines
+
working-tree-encodingattribute. For example, the following pattern sets allDocumentation/gitfaq.txt new file +6
-0+C files to use UTF-16LE-BOM, which is a common encoding on Windows: +[[windows-diff-control-m]] +I'm on Windows and git diff shows my files as having a `^M` at the end.:: + By default, Git expects files to be stored with Unix line endings. As + such, the carriage return (`^M`) that is part of a Windows line ending + results is show because it is considered to be trailing whitespace. Git
"results is show"? "is shown"? Perhaps with a comma after "shown" for better reading flow (IMVHO).
Documentation/gitfaq.txt line 318
Quoted 4 lines
Documentation/gitfaq.txt new file +3
-0+ defaults to showing trailing whitespace only on new lines, not existing + ones. +We also recommend setting a link:gitattributes[5] file to explicitly mark which
s/link:/linkgit:/
Thanks a lot. This is really well-written, and I think the selection of questions makes a lot of sense.
Martin
Re: [PATCH v2] docs: add a FAQ
Quoted 7 lines · Martin Ågren
Quoted 3 lines · brian m. carlson
Note that the long lines for certain questions are required, since Asciidoctor does not permit broken lines there.
---Missing sign-off.
Thanks, will fix.
Quoted 7 lines
Documentation/gitfaq.txt line 108
Quoted 4 lines
Documentation/gitfaq.txt new file +4
-0+You can also just enter your password when prompted, or you can place the +password (which must be percent-encoded) in the URL. The latter option is not +particularly secure and can lead to accidental exposure of credentials, so it is +not recommended.So should we even mention it? Or should we use the "it is sometimes (erroneously) suggested" construct?
I'll rephrase this to make it a little more obvious that this is a bad idea.
Quoted 7 lines
Documentation/gitfaq.txt line 165
Quoted 5 lines
Documentation/gitfaq.txt new file +5
-0+Most hosting providers use a single SSH account for pushing; that is, all users +push to the `git` account (e.g., `[email protected]`). If that's the case for +your provider, you can set up multiple aliases in SSH to make it clear which key +pair to use. For example, you could write something like the following, +substituting the proper private key file:Would this be in
~/.ssh/config?
Ah, yes, we should tell that to the user.
Quoted 4 lines
Quoted 4 lines
++
+----Documentation/gitfaq.txt new file +2
-0+# This is the account for author on git.example.org. +Host example_author
Quoted 8 lines
Documentation/gitfaq.txt line 175
Quoted 6 lines
Documentation/gitfaq.txt new file +6
-0+ HostName git.example.org + User git + # This is the key pair registered for author with git.example.org. + IdentityFile ~/.ssh/id_author + IdentitiesOnly yes +# This is the committer for author on git.example.org.Looks like you did s/account/committer/ instead of s/author/committer/?
So I did.
Quoted 7 lines
Documentation/gitfaq.txt line 194
Quoted 5 lines
Documentation/gitfaq.txt new file +5
-0+ +[[last-commit-amend]] +I've made a mistake in the last commit. How do I change it?:: + You can make the appropriate change to your working tree, run `git add + <file>` or `git rm <file>`, as approrpiate, to stage it, and then `gittypoed "appropriate"
Will fix.
Quoted 14 lines
Quoted 2 lines
+[[restrict-with-hooks]]
+How do I prevent users from making certain changes with hooks?::I read this as:
How do I prevent users from making "certain changes with hooks"?
As opposed to your intended meaning:
How do I (with hooks) prevent users from making certain changes?
I'm not suggesting the latter as a "fix" for this "problem" though, since it's a bit clumsy. How about adding a comma:
Quoted 6 lines
How do I prevent users from making certain changes, with hooks?
Or maybe just dropping those last two words.
Please trust your judgement on whether this is a problem, and if so, how to go about addressing it -- I know you have lots of such judgement.
How about, "How do I use hooks to prevent users from making certain changes?" That seems to both read smoothly and avoid the misplaced modifier.
Quoted 5 lines
Quoted 2 lines
+Cross-Platform Issues
+~~~~~~~~~~~~~~~~~~~~~I think you meant to use "--" as everywhere else instead of "~~". This is not a subsection of "Hooks".
Ah, yes. Apparently my fonts are so small that these are hard to distinguish with bright white on grey. I typically use the Setext style in my own documents, but that isn't what we do in Git.
Quoted 3 lines
Quoted 1 line
+To do so, you can specify a linkgit:gitattributes[5] pattern with with the
"with with"
Ah, normally Vim flags those things. Will fix.
Quoted 8 lines
Documentation/gitfaq.txt line 284
Quoted 5 lines
+[[windows-diff-control-m]]
Documentation/gitfaq.txt new file +4
-0+I'm on Windows and git diff shows my files as having a `^M` at the end.:: + By default, Git expects files to be stored with Unix line endings. As + such, the carriage return (`^M`) that is part of a Windows line ending + results is show because it is considered to be trailing whitespace. Git"results is show"? "is shown"? Perhaps with a comma after "shown" for better reading flow (IMVHO).
This should be "is shown". I'm not sure if a comma after "shown" is grammatical here as it stands, but I think we could write "is shown, since" and that would be okay. I'll check a reference and rephrase if necessary.
Quoted 6 lines
Documentation/gitfaq.txt line 318
Quoted 4 lines
Documentation/gitfaq.txt new file +3
-0+ defaults to showing trailing whitespace only on new lines, not existing + ones. +We also recommend setting a link:gitattributes[5] file to explicitly mark whichs/link:/linkgit:/
Will fix.
Signature · 2 lines
brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204
Re: [PATCH v2] docs: add a FAQ
Quoted 16 lines · brian m. carlson
Quoted 14 lines · Martin Ågren
On Wed, 25 Mar 2020 at 02:37, brian m. carlson
I read this as:How do I prevent users from making "certain changes with hooks"?
As opposed to your intended meaning:
How do I (with hooks) prevent users from making certain changes?
I'm not suggesting the latter as a "fix" for this "problem" though, since it's a bit clumsy. How about adding a comma:
How do I prevent users from making certain changes, with hooks?
Quoted 8 lines
Quoted 4 lines
Or maybe just dropping those last two words.
Please trust your judgement on whether this is a problem, and if so, how to go about addressing it -- I know you have lots of such judgement.
How about, "How do I use hooks to prevent users from making certain changes?" That seems to both read smoothly and avoid the misplaced modifier.
Very nice.
Martin
Quoted 4 lines · brian m. carlson
I know there are some plans to add additional entries to this. I propose we tack them on as additional patches, and if I need to reroll this again, I can pick them up as part of the series, unless someone has strong opinions about doing things differently.
I do not have a strong opinion, but have a mild preference for the way you are proposing. Let's take this almost as-is (modulo fixes to possible typos if people spot any soon enough) and leave the enhancement to follow-up patches.