Windows安装配置Git

编程知识 更新时间:2023-04-12 13:28:01

一、安全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

本文发布于:2023-04-10 21:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/914894f16e15320b54d7714783653dd2.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Windows   Git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 66095文章数
  • 14阅读数
  • 0评论数