使用
git bash
的过程中,除了常用的那几条,其它的总需要查找手册,索性跟着大牛总结的文章走一遍吧
前言
- Workspace: 工作区
- Index / Stage: 暂存区
- Repository: 仓库区(或本地仓库)
- Remote: 远程仓库
新建
# 在当前目录 git-command 下新建 Git 代码库,(会生成 .git 文件)
git init
# 新建目录 git-command 并将其初始化为 Git 代码库
git init git-command
# 从线上获取一个完整的项目代码
git clone https://github.com/yangtao2o/git-command.git
配置
Git的设置文件为 .gitconfig
,它可以在用户主目录下(全局配置),也可以在项目目录下(项目配置)。
# 显示配置信息
git config --list
# 修改
git config --global
git config --global user.name "yangtao"
git config --global user.email "xxx@.qq.com"