放肆青春的博客
首页
前端
算法
网络
面试
技术
后端
运维
杂项
数据库
工具
网址
电脑
个人
文章
  • 分类
  • 标签
  • 归档
github (opens new window)
gitee (opens new window)

放肆青春

一个前端菜鸟的技术成长之路
首页
前端
算法
网络
面试
技术
后端
运维
杂项
数据库
工具
网址
电脑
个人
文章
  • 分类
  • 标签
  • 归档
github (opens new window)
gitee (opens new window)
  • 开发相关

    • 项目管理

      • 团队工具
      • git

        • git 汇总

          • git
          • git 总结
          • git 配置
            • git 配置
              • git 大小写敏感配置
              • git 配置密钥
              • git 配置别名
              • git 配置用户名邮箱
              • git 配置密钥 config 文件
              • git 配置命令
          • git 命令
          • github
          • gitee
          • svn
        • git blog

      • UI 及 UE工具
      • 代码管理
      • jenkins
      • sonar
      • 移动端调试
      • nexus
    • 开发工具

      • node
      • npm
      • yarn
      • pm2
      • pnpm
      • safe
      • eslint
      • gitbook
      • vuepress 总结
      • vitepress
      • markdown
    • 开发软件

      • software
      • vscode
      • postman
      • SourceTree
      • idea
      • sublime
      • notepad
      • ediplus
      • xmind
    • 浏览器

      • chrome 汇总
      • chrome lighthouse
      • firefox
  • office

    • excel

      • excel
    • word

      • word
    • ppt

      • ppt
  • 实用工具

    • ps
    • premiere
  • tools
放肆青春
2020-07-16

git 配置

# git 配置

# git 大小写敏感配置

  • 查看 git 的设置 git config --get core.ignorecase

true 为不敏感,false 为敏感 发现默认是不区分大小的,因此当你修改了文件名的大小写后,git 并不会认为你有修改哦

  • 更改设置 git config core.ignorecase false

# git 配置密钥

注意点 1:-C 后面跟的邮箱不能跟 gitee,github,gitlab 之前配置过的密钥使用过的邮箱重复
id_rsa_gitee, id_rsa_gitlab,id_rsa_github 注意点 2:文件下必须存在 id_rsa 和 id_rsa.pub,可以以公司 gitlab 命名为默认 id_rsa,github 和 gitee 以 id_rsa_github 和 id_rsa_gitee 命名

  1. ssh-keygen -t rsa -C "youremail@example.com"
  2. 打开 id_rsa.pub
  3. 复制内容到 github 添加 SSH 密钥,,然后在仓库邀请队友,邀请后队友邮箱接收到信息,队长再把仓库邀请地址发给队友,队友就可以协同开发了
  4. 先初始化本地仓库,再 pull
  5. git init
  6. git pull

# git 配置别名

  • 命令行配置别名

git config --global alias.pl pull

  • 配置文件配置别名

    C:\Users\wangzhen.DOMRST.gitconfig 用户文件下编辑

[user]
	name = wangzhen
	email = wangzhen05@wondersgroup.com
[credential]
	helper = manager
[alias]
  co=checkout
	ci=commit
	st=status
	sh=stash
	pl=pull
	ps=push
  dt=difftool
	l=log—stat
	cp=cherry-pick
	ca=commit-a
	b=branch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# git 配置用户名邮箱

  • 配置全局用户名和邮箱(不加双引号)

git config --global user.email 1947914887@qq.com

git config --global user.name xxx

  • 配置单个项目仓库用户名和邮箱

git config user.email 1947914887@qq.com

git config user.name xxx

# git 配置密钥 config 文件

  • config 文件

路径 C:\Users\wangzhen.ssh\config

# github
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_github

# gitLab
    Host git@11.241.65.201
    HostName git@11.241.65.201
    User git
    IdentityFile ~/.ssh/id_rsa_gitlab

# gitee
Host gitee.com
    Port 22
    HostName gitee.com
    User git
    IdentityFile ~/.ssh/id_rsa_gitee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# git 配置命令

  • 列出所有 Git 当时能找到的配置

    git config --list

  • 查看系统配置

    git config --system --list

  • 查看当前用户配置

    git config --global --list

  • 展示某一项配置

    git config user.name

  • 配置用户名和邮箱

git config --global user.name "John Doe"

git config --global user.email johndoe@example.com

  • 配置单个项目仓库用户名和邮箱

git config user.email 1947914887@qq.com

git config user.name xxx

  • 取消 git 的全局设置:

git config --global --unset user.name

git config --global --unset user.email

更新时间: 5/28/2021, 4:49:34 PM
git 总结
git 命令

← git 总结 git 命令→

最近更新
01
前端权限管理
02-24
02
vue2指令
02-24
03
vue2 hook
02-24
更多文章>
Theme by Vdoing | Copyright © 2019-2022 放肆青春
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式