一. 理解
- Workspace:工作区
- Index / Stage:暂存区
- Repository:仓库区(或本地仓库)
- Remote:远程仓库
二. 新建Repository
- 创建本地仓库
1
2
3
4
5
6
7git init #git 初始化
git add . #添加所有文件到暂存区
git commit -m "content" #添加备注提交本地仓库
git remote add origin http://url.git # 添加远程仓库路径
git push -u origin master #push 代码到远程仓库
git push remote [remote][branch] #上面两行代码的合并
2.复制远程仓库1
git clone [url]
三. 配置
1 | git config --list #显示所有Git配置 |
四. 需要记住的
1 | git add . |