Files
sysconfig/git_config.sh
luk 9742f6dab2 refactor: 脚本及配置文件命名统一用 _ 分隔
将 .sh/.bat 脚本与 .js/.plist/.Dockerfile 等文件中以 - 分隔的文件名
改为 _ 分隔,dcloud-renew 目录改为 dcloud、script_nuance 目录改为
nuance,并同步更新脚本内部引用与 README 路径。

Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
2026-08-25 15:11:50 +08:00

79 lines
2.7 KiB
Bash
Executable File

#!/bin/bash
echo "---------------------------------------------"
echo "Set [user name] or leave blank for unchanged \"$(git config --get user.name)\""
read -p "***:: " UserName
if [ $UserName ]
then
echo "git config --global user.name $UserName"
git config --global user.name $UserName
fi
echo "---------------------------------------------"
echo "User Email (leave blank for unchanged $(git config --get user.email))"
read -p "***:: " UserEmail
if [ $UserEmail ]
then
echo "git config --global user.email $UserEmail"
git config --global user.email $UserEmail
fi
echo "---------------------------------------------"
echo "如果 git 远程服务器的 ssl 证书过期,或者使用了自颁发的证书,连接时会出现验证错误 Cannot verify local issuer"
echo "Verify ssl? (true, false, or leave blank for unchanged $(git config --get http.sslVerify))"
read -p "***:: " HttpSslVerify
if [ $HttpSslVerify ]
then
echo "git config --global http.sslVerify $HttpSslVerify"
git config --global http.sslVerify $HttpSslVerify
fi
echo "---------------------------------------------"
echo "Store credential in [cache] or [store]? (leave blank for unchanged $(git config --get credential.helper))"
read -p "***:: " CredentialHelper
if [ $CredentialHelper ]
then
echo "git config --global credential.helper $CredentialHelper"
git config --global credential.helper $CredentialHelper
fi
echo "---------------------------------------------"
echo "Store pull rebase to [true] or [false]? (leave blank for unchanged $(git config --get pull.rebase))"
read -p "***:: " PullRebase
if [ $PullRebase ]
then
echo "git config --global pull.rebase $PullRebase"
git config --global pull.rebase $PullRebase
fi
echo "---------------------------------------------"
echo "Set [path to global gitignore file] or leave blank for unchanged $(git config --get core.excludesfile)"
read -p "***:: " ExcludesFile
if [ $ExcludesFile ]
then
echo "git config --global core.excludesfile $ExcludesFile"
git config --global core.excludesfile $ExcludesFile
else
echo "File not exsit: $ExcludesFile"
fi
echo "---------------------------------------------"
echo "Set default branch since git 2.28 to master or main? (leave blank for unchanged $(git config --get init.defaultbranch))"
read -p "***:: " DefaultBranch
if [ $DefaultBranch ]
then
echo "git config --global init.defaultbranch $DefaultBranch"
git config --global init.defaultbranch $DefaultBranch
fi
echo "---------------------------------------------"
echo "Set postBuffer size? Suggesting 157286400 (leave blank for unchanged $(git config --get http.postBuffer))"
read -p "***:: " PostBufferSize
if [ $PostBufferSize ]
then
echo "git config --global http.postBuffer $PostBufferSize"
git config --global http.postBuffer $PostBufferSize
fi