Re: [PATCH 6/7] user-manual: add global config section
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 1, 2009, 22:08 UTC
- Message-ID
- <7v3abowk6v.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <94a0d4530905010137h772b53f1q8af0d30400a05043@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 7 quoted lines
>> For that "introductory" purpose, however, I'd suggest showing how they >> appear in the actual .git/config file first in the editor and then show a >> way to use the "git config" command as an alternative. > > I disagree. Opening ~/.gitconfig will just open an empty file for the > new users, afterwards they'll just scratch their heads wondering, now > what?
Why on earth would anybody start introducing ~/.gitconfig before talking about .git/config?
A good sequence would be:
To start working on a tarball extract (or your uncontrolled project) with git, first do:
$ git init
Whoa. That was fast. Did it do anything? Yes, it created a subdirectory .git that is going to store your history and other control information. Right now you do not have any history (nor the current state for that matter) recorded in it, but it already has some control information. One of the more important one is the per-repository configuration file. Take a look:
$ git config --edit
It would show something like:
[core]
...... explain a bit on how simple the configuration syntax is ...
While you have it open, it would be a good idea to add this to
introduce yourself to git: [user]
email = clueful@git.us.er
name = My SelfIf you work in multiple projects under the same identity, you do not have to add user.email and user.name to each and every repository this way. Instead, you can do that to your per-user configuration file, like:
$ git config --global --edit
but if you work in different projects using different mail address (e.g. work vs hobby projects), you would want to have this information per-repository.