需要在你的仓库中添加一个.gitattributes文件,标记正确的行结束符、应该被改正的文本文件和不应该被修改的二进制文件。 在仓库根目录(与 .git 位于同一文件夹中)下创建一个名为 .gitattributes 的新文本文件。
git config --global core.autocrlf input
# 设置所有文件的默认行为
*.text=auto# 列出应使用系统相关的行结束符的文本文件
*.php text
*.html text
*.css text# 列出应使用CRLF行结束符且不根据本地操作系统转换的文件
*.sln text eol=crlf# 列出所有不应进行修改的二进制文件
*.png binary
*.jpg binary
*.gif binary
*.ico binary
git add .gitattributes
git commit -m "Require the right line endings for everyone, forever."
git config --global core.quotepath false
以下是一些常见的开源许可证:
使用了SSH密钥后,在连接到远程机器时就不需要每次输入密码。密钥本身是成对出现的:一个公钥和一个私钥。应该将私钥当作密码对待,且永远不应该与别人共享。公钥将会被“安装”在其他地方,例如代码托管系统中。
创建你自己的SSH密钥
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
获得你的SSH公钥
文件位于~/.ssh/id_rsa.pub,把这个复制到代码托管的设置里面。