Skip to content

Instantly share code, notes, and snippets.

@eddy8
Last active January 5, 2025 12:37
Show Gist options
  • Save eddy8/6613a4a2fa2d359d27ecf676c3de1da9 to your computer and use it in GitHub Desktop.
Save eddy8/6613a4a2fa2d359d27ecf676c3de1da9 to your computer and use it in GitHub Desktop.
git 注意事项

换行符的自动转换问题

#全局配置
git config --global core.autocrlf false

#仓库单独配置,在仓库目录下执行
git config core.autocrlf false

core.autocrlf有以下三种配置,建议设置为false

  • false:不进行换行符的自动转换,保留文件的原始换行符。
  • true:启用换行符自动转换。
  • input:仅在提交时将 CRLF 转换为 LF,但签出时不做任何转换。

多私钥及代理配置

~/.ssh/config文件中进行配置,需要使用代理的话提前安装 corkscrew :

Host your_repository_host
    HostName your_repository_host
    User testuser
    IdentityFile your_private_key_path
    ProxyCommand /opt/homebrew/Cellar/corkscrew/2.0/bin/corkscrew your_proxy_ip your_proxy_port %h %p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment