Home Explore Blog CI



git

4th chunk of `Documentation/config/core.adoc`
351ca11070f28020458bd9360d7b4580ec196a3f3ea6a4f90000000100000fa5
 accidentally classified as text the
conversion can corrupt data.
+
If you recognize such corruption early you can easily fix it by
setting the conversion type explicitly in .gitattributes.  Right
after committing you still have the original file in your work
tree and this file is not yet corrupted.  You can explicitly tell
Git that this file is binary and Git will handle the file
appropriately.
+
Unfortunately, the desired effect of cleaning up text files with
mixed line endings and the undesired effect of corrupting binary
files cannot be distinguished.  In both cases CRLFs are removed
in an irreversible way.  For text files this is the right thing
to do because CRLFs are line endings, while for binary files
converting CRLFs corrupts data.
+
Note, this safety check does not mean that a checkout will generate a
file identical to the original file for a different setting of
`core.eol` and `core.autocrlf`, but only for the current one.  For
example, a text file with `LF` would be accepted with `core.eol=lf`
and could later be checked out with `core.eol=crlf`, in which case the
resulting file would contain `CRLF`, although the original file
contained `LF`.  However, in both work trees the line endings would be
consistent, that is either all `LF` or all `CRLF`, but never mixed.  A
file with mixed line endings would be reported by the `core.safecrlf`
mechanism.

core.autocrlf::
	Setting this variable to "true" is the same as setting
	the `text` attribute to "auto" on all files and core.eol to "crlf".
	Set to true if you want to have `CRLF` line endings in your
	working directory and the repository has LF line endings.
	This variable can be set to 'input',
	in which case no output conversion is performed.

core.checkRoundtripEncoding::
	A comma and/or whitespace separated list of encodings that Git
	performs UTF-8 round trip checks on if they are used in an
	`working-tree-encoding` attribute (see linkgit:gitattributes[5]).
	The default value is `SHIFT-JIS`.

core.symlinks::
	If false, symbolic links are checked out as small plain files that
	contain the link text. linkgit:git-update-index[1] and
	linkgit:git-add[1] will not change the recorded type to regular
	file. Useful on filesystems like FAT that do not support
	symbolic links.
+
The default is true, except linkgit:git-clone[1] or linkgit:git-init[1]
will probe and set core.symlinks false if appropriate when the repository
is created.

core.gitProxy::
	A "proxy command" to execute (as 'command host port') instead
	of establishing direct connection to the remote server when
	using the Git protocol for fetching. If the variable value is
	in the "COMMAND for DOMAIN" format, the command is applied only
	on hostnames ending with the specified domain string. This variable
	may be set multiple times and is matched in the given order;
	the first match wins.
+
Can be overridden by the `GIT_PROXY_COMMAND` environment variable
(which always applies universally, without the special "for"
handling).
+
The special string `none` can be used as the proxy command to
specify that no proxy be used for a given domain pattern.
This is useful for excluding servers inside a firewall from
proxy use, while defaulting to a common proxy for external domains.

core.sshCommand::
	If this variable is set, `git fetch` and `git push` will
	use the specified command instead of `ssh` when they need to
	connect to a remote system. The command is in the same form as
	the `GIT_SSH_COMMAND` environment variable and is overridden
	when the environment variable is set.

core.ignoreStat::
	If true, Git will avoid using lstat() calls to detect if files have
	changed by setting the "assume-unchanged" bit for those tracked files
	which it has updated identically in both the index and working tree.
+
When files are modified outside of Git, the user will need to stage
the modified files explicitly (e.g. see 'Examples' section in
linkgit:git-update-index[1]).
Git will not normally detect changes to those files.
+
This is useful

Title: Git Configuration Variables for Line Endings, Encoding, and Networking
Summary
This section describes various Git configuration variables, including those related to line endings, encoding, symbolic links, proxy settings, and SSH commands, which can be used to customize Git's behavior and improve performance in different environments and use cases.