美文网首页
Git 基础配置

Git 基础配置

作者: Tinyspot | 来源:发表于2022-09-29 21:12 被阅读0次

1. 查看 Git 配置

  • 帮助文档 $ git

查看配置

$ git config --list

修改 user.name/user.email

$ git config --global --replace-all user.name "your user name"
$ git config --global --replace-all user.email "your user email"

2. 初次配置

# 1. 设置用户名和邮箱
$ git config --global user.name "yourName"
$ git config --global user.email "email@example.com"

# 2. 生成密钥
$ ssh-keygen -t rsa -C "youremail@example.com"
# 按 3 个回车,密码为空

# 3. 添加 SSH 密钥 `id_rsa.pub`

查看密钥是否存在 $ cd ~/.ssh

3. Git 介绍

3.1 工作原理

  • 工作目录、暂存目录(也叫做索引)和仓库
  • 先提交到本地仓库,再推送到远程长裤
git-repository.png

3.2 常用命令

git status
git add -A  // 提交所有变化
git add -u  // 提交被修改和被删除文件,不包括新文件(new)
git add .   // 提交新文件和被修改文件,不包括被删除文件
git add file1 file2 file3
git clone
git checkout
git add  // 将文件加入库跟踪区
git commit // 提交到本地代码库
git push  // 提交到远程仓库

相关文章

  • git基础操作

    本文主要涉及:1: git 配置2: git基础常见命令3: 容器git配置 1. git服务器配置 2. git...

  • Git

    关于版本控制 Git 简史 Git 基础 安装 Git Git 前的配置

  • git的使用总结

    基础配置 git config --global user.name "lixinxin"git config -...

  • Git总结

    初步 下载git 基础配置: 基础操作 获取Git仓库 初始化现有仓库 git init 克隆远程仓库 git c...

  • git 的简单使用

    git基础配置: git config --global user.name "your name" git co...

  • git初解

    title: git配置&使用date: 2017-06-01 git 本文介绍如何在安装了git的基础上怎么配置...

  • Git的使用

    1.安装好git后进行基础配置,作为 git 的基础配置,作用是告诉 git 你是谁,你输入的信息将出现在你创建的...

  • Git 基础实践

    Git基础实践 配置 SSH vs Http(s) git configgitlab/github中的git co...

  • Git 常用的命令

    1、查看帮助:git --help 2、查看某一命令帮助:`git add -h 二、基础配置 需要配置:user...

  • git ------ 将本地项目推送到远程空仓库

    番外:基础配置 //1.配置全局的git仓库的 用户名 和 邮箱 git config --global user...

网友评论

      本文标题:Git 基础配置

      本文链接:https://www.haomeiwen.com/subject/bsnmvrtx.html