1. 新建本地代码仓库
git config --global user.name "用户名" 配置用户名
git config --global user.email "邮箱" 配置邮箱
git config --global init.defaultBranch master 配置分支名称
git config -l 查看配置信息
git init 初始化仓库
2. 提交代码
git add 具体文件/文件夹/.(所有) 添加到缓冲区
git reset 从缓冲区踢出所有
git commit -m "注释" 提交
3. 忽略文件
1) 在添加目录下创建,.gitignore文件
2) 格式如下:
bulid/
install/
log/
3) git add .gitignore
4. 其他命令
git log 查看提交记录