一、安全Git
-
git官网:Githttps://git-scm/
-
第一步:安装信息页
-
第二步:安装目录选择
-
第三步:选择安装组件:默认不修改
-
第四步:选择创建开始菜单
-
第五步:选择使用Git时的编辑器样式
-
第六步:默认选择
-
第七步:选择设置环境变量,默认选择
-
第八步:选择SSH扩展,默认选择
-
第九步:选择HTTPS相关选项,默认选择
-
第十步:配置换行符,默认选择
-
第十一步:配置控制台,默认选择
-
第十二步:配置git pull行为,默认选择
-
第十三步:选择帮助文档,默认选择
-
第十四步:选择配置扩展选项,默认选择
-
第十五步:继续配置扩展选项,默认选择
-
第十六步:开始安装
-
第十七步:安装完成
二、Git配置
初始化Git
-
任务:完成Git用户配置
-
方法:通过
git config
命令 -
命令格式:
git config [<options>]
-
说明:
配置文件位置: --global 使用全局配置文件 --system 使用系统配置文件 --local use repository config file --worktree use per-worktree config file -f, --file <file> use given config file --blob <blob-id> read config from given blob object Action --get get value: name [value-pattern] --get-all get all values: key [value-pattern] --get-regexp get values for regexp: name-regex [value-pattern] --get-urlmatch get value specific for the URL: section[.var] URL --replace-all replace all matching variables: name value [value-pattern] --add add a new variable: name value --unset remove a variable: name [value-pattern] --unset-all remove all matches: name [value-pattern] --rename-section rename section: old-name new-name --remove-section remove a section: name -l, --list list all --fixed-value use string equality when comparing values to 'value-pattern' -e, --edit open an editor --get-color find the color configured: slot [default] --get-colorbool find the color setting: slot [stdout-is-tty] Type -t, --type <> value is given this type --bool value is "true" or "false" --int value is decimal number --bool-or-int value is --bool or --int --bool-or-str value is --bool or string --path value is a path (file or directory name) --expiry-date value is an expiry date Other -z, --null terminate values with NUL byte --name-only show variable names only --includes respect include directives on lookup --show-origin show origin of config (file, standard input, blob, command line) --show-scope show scope of config (worktree, local, global, system, command) --default <value> with --get, use default value when missing entry
-
-
配置git用户
-
命令:
git config --global [user.name](http://user.name/) "ulrica"
-
-
配置git用户密码
-
命令:
git config --global user.email "[ulricawolfking@yeah](mailto:ulricawolfking@yeah)"
-
-
检查配置是否成功
-
命令:
git config --list
-
结果:
-
更多推荐
Windows安装配置Git
发布评论