You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Before you start on a large rewrite or other major change: open a new issue first, to discuss the proposed changes. -->
3
+
<!-- Should your changes appear in a printed edition, you'll be included in the contributors list. -->
4
+
5
+
<!-- Mark the checkbox [X] or [x] if you agree with the item. -->
6
+
-[ ] I provide my work under the [project license](https://github.com/progit/progit2/blob/master/LICENSE.asc).
7
+
-[ ] I grant such license of my work as is required for the purposes of future print editions to [Ben Straub](https://github.com/ben) and [Scott Chacon](https://github.com/schacon).
8
+
9
+
## Changes
10
+
11
+
-
12
+
13
+
## Context
14
+
<!--
15
+
List related issues.
16
+
Provide the necessary context to understand the changes you made.
17
+
18
+
Are you fixing a issue with this pull-request?
19
+
Use the "Fixes" keyword, to close the issue automatically after your work is merged.
Copy file name to clipboardExpand all lines: C-git-commands.asc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -568,7 +568,7 @@ The `git filter-branch` command is used to rewrite loads of commits according to
568
568
569
569
In <<ch07-git-tools#_removing_file_every_commit>> we explain the command and explore several different options such as `--commit-filter`, `--subdirectory-filter` and `--tree-filter`.
570
570
571
-
In <<ch09-git-and-other-systems#_git_p4>> and <<ch09-git-and-other-systems#_git_tfs>> we use it to fix up imported external repositories.
571
+
In <<ch09-git-and-other-systems#_git_p4>> we use it to fix up imported external repositories.
By opening a pull request to this repository, you agree to provide your work under the [project license](LICENSE.asc).
5
+
When you open a pull request, you agree to provide your work under the [project license](LICENSE.asc).
6
6
Also, you agree to grant such license of your work as is required for the purposes of future print editions to @ben and @schacon.
7
7
Should your changes appear in a printed edition, you'll be included in the [contributors list](book/contributors.asc).
8
8
9
9
## Signaling an Issue
10
10
11
-
Before signaling an issue, please check that there isn't already a similar one in the bug tracking system.
11
+
Search for similar issues, before creating a new issue.
12
12
13
-
Also, if this issue has been spotted on the git-scm.com site, please cross-check that it is still present in the pdf version.
14
-
The issue may have already been corrected, but the changes have not been deployed yet.
13
+
Also, if this issue has been spotted on the git-scm.com site, cross-check that the issue is present in the pdf version.
14
+
The issue may have already been corrected in the source files, but not yet deployed to the git-scm.com site.
15
15
16
16
## Small Corrections
17
17
18
18
Errata and basic clarifications will be accepted if we agree that they improve the content.
19
-
You can also open an issue so we can figure out how or if it needs to be addressed.
19
+
You can also open an issue so that we can discuss how or if the issue needs to be addressed.
20
20
21
21
If you've never done this before, the [flow guide](https://guides.github.com/introduction/flow/) might be useful.
22
22
23
23
## Large Rewrites
24
24
25
25
Open an issue for discussion before you start.
26
-
These changes tend to be very subjective, often only clarifying things for some small percentage of people and it's rarely worth the time to accept them.
27
-
Professional copy editors have already reviewed this content multiple times so while you may have somewhat better taste and grammar than we do it's unlikely that your prose is going to be *so* much better that it's worth changing vast swaths of text.
26
+
A large rewrite tends to be very subjective, often only clarifying things for a small amount of readers.
27
+
Professional copy editors have already reviewed this content multiple times.
28
+
It's unlikely that your prose is going to be *so* much better that it's worth changing large portions of text.
28
29
29
30
## Figures
30
31
31
-
The images in this book were generated using [Sketch 3](https://www.sketchapp.com/), with the [included sketchbook file](diagram-source/progit.sketch).
32
+
The images in this book are generated using [Sketch 3](https://www.sketchapp.com/), with the [included sketchbook file](diagram-source/progit.sketch).
32
33
33
-
To add a figure:
34
+
To create a figure:
34
35
35
36
1. Add a page to the sketchbook.
36
-
Try to use the included symbols wherever possible.
37
+
Use the included symbols wherever possible.
37
38
2. Add a "slice" to your page.
38
-
Give it a name that matches the destination PNG filename, relative from the root of the source directory.
39
-
3. Make sure your slice is set to export at "800w".
40
-
39
+
Name the slice so that it matches the destination PNG filename, relative from the root of the source directory.
40
+
3. Set your slice to export at "800w".
41
41
42
42
## Translations
43
43
44
-
If you would like to contribute to translating Pro Git into your language, take a look at [TRANSLATING.md](TRANSLATING.md).
44
+
If you want to contribute to translating Pro Git into your language, take a look at [TRANSLATING.md](TRANSLATING.md).
Copy file name to clipboardExpand all lines: book/01-introduction/sections/first-time-setup.asc
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ You can also change them at any time by running through the commands again.
8
8
Git comes with a tool called `git config` that lets you get and set configuration variables that control all aspects of how Git looks and operates.(((git commands, config)))
9
9
These variables can be stored in three different places:
10
10
11
-
1. `/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories.
11
+
1. `[path]/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories.
12
12
If you pass the option `--system` to `git config`, it reads and writes from this file specifically.
13
13
Because this is a system configuration file, you would need administrative or superuser privilege to make changes to it.
14
14
2. `~/.gitconfig` or `~/.config/git/config` file: Values specific personally to you, the user.
@@ -17,10 +17,10 @@ These variables can be stored in three different places:
17
17
You can force Git to read from and write to this file with the `--local` option, but that is in fact the default.
18
18
Unsurprisingly, you need to be located somewhere in a Git repository for this option to work properly.
19
19
20
-
Each level overrides values in the previous level, so values in `.git/config` trump those in `/etc/gitconfig`.
20
+
Each level overrides values in the previous level, so values in `.git/config` trump those in `[path]/etc/gitconfig`.
21
21
22
22
On Windows systems, Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people).
23
-
It also still looks for `/etc/gitconfig`, although it's relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer.
23
+
It also still looks for `[path]/etc/gitconfig`, although it's relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer.
24
24
If you are using version 2.x or later of Git for Windows, there is also a system-level config file at
25
25
`C:\Documents and Settings\All Users\Application Data\Git\config` on Windows XP, and in `C:\ProgramData\Git\config` on Windows Vista and newer.
26
26
This config file can only be changed by `git config -f <file>` as an admin.
@@ -84,6 +84,18 @@ You may find, if you don't setup your editor like this, you get into a really co
84
84
An example on a Windows system may include a prematurely terminated Git operation during a Git initiated edit.
85
85
====
86
86
87
+
==== Your default branch name
88
+
89
+
By default Git will create a branch called _master_ when you create a new repository with `git init`.
90
+
From Git version 2.28 onwards, you can set a different name for the initial branch.
91
+
92
+
To set _main_ as the default branch name do:
93
+
94
+
[source,console]
95
+
----
96
+
$ git config --global init.defaultBranch main
97
+
----
98
+
87
99
==== Checking Your Settings
88
100
89
101
If you want to check your configuration settings, you can use the `git config --list` command to list all the settings Git can find at that point:
@@ -100,7 +112,7 @@ color.diff=auto
100
112
...
101
113
----
102
114
103
-
You may see keys more than once, because Git reads the same key from different files (`/etc/gitconfig` and `~/.gitconfig`, for example).
115
+
You may see keys more than once, because Git reads the same key from different files (`[path]/etc/gitconfig` and `~/.gitconfig`, for example).
104
116
In this case, Git uses the last value for each unique key it sees.
105
117
106
118
You can also check what Git thinks a specific key's value is by typing `git config <key>`:(((git commands, config)))
Now you'll learn a few of the more interesting options that you can set in this manner to customize your Git usage.
15
15
16
16
First, a quick review: Git uses a series of configuration files to determine non-default behavior that you may want.
17
-
The first place Git looks for these values is in the system-wide `/etc/gitconfig` file, which contains settings that are applied to every user on the system and all of their repositories.
17
+
The first place Git looks for these values is in the system-wide `[path]/etc/gitconfig` file, which contains settings that are applied to every user on the system and all of their repositories.
18
18
If you pass the option `--system` to `git config`, it reads and writes from this file specifically.
19
19
20
20
The next place Git looks is the `~/.gitconfig` (or `~/.config/git/config`) file, which is specific to each user.
@@ -24,7 +24,7 @@ Finally, Git looks for configuration values in the configuration file in the Git
24
24
These values are specific to that single repository, and represent passing the `--local` option to `git config`.
25
25
If you don't specify which level you want to work with, this is the default.
26
26
27
-
Each of these ``levels'' (system, global, local) overwrites values in the previous level, so values in `.git/config` trump those in `/etc/gitconfig`, for instance.
27
+
Each of these ``levels'' (system, global, local) overwrites values in the previous level, so values in `.git/config` trump those in `[path]/etc/gitconfig`, for instance.
0 commit comments