一、操作步骤
1、gitbub 官网注册用户并登录
https://github.com/
user: myName
email: my@163.com
2、gitbub 上新建仓库
仓库项目名为: AsdDemo
3、本地安装git 客户端
4、下载项目到本地
git clone https://github.com/myName/AsdDemo.git
5、本地git配置
git config --global user.name “myName”
git config --global user.email “my@163.com”
二、git常用命令
git config
- 优先级
仓库级别 local > 用户级别 global > 系统级别 system
- 添加
配置本地仓库user.name (user.email类似)
git config --local user.name "myName"
或 git config user.name "myName"
- 编辑
git config --local -e 编辑仓库级别配置文件
git config --global -e 编辑用户级别配置文件
git config --system -e 编辑系统级别配置文件
- 查看
git config --global -l
git config --local -l
git config -l
- 删除
git config --global --unset http.proxy
提交代码
git add . //添加所有文件到本地仓库
git commit -m "add first" //把文件提交到本地仓库
git push //把文件提交到服务器仓库
或git push origin HEAD:master