Windows安装配置Git

一、安全Git

  • git官网:Giticon-default.png?t=M3K6https://git-scm.com/

  • 第一步:安装信息页

  • 第二步:安装目录选择
     

  • 第三步:选择安装组件:默认不修改

  • 第四步:选择创建开始菜单
     

  • 第五步:选择使用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.net](mailto:ulricawolfking@yeah.net)"

  • 检查配置是否成功

    • 命令: git config --list

    • 结果:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值