1.本地创建新仓库
创建新文件夹,打开终端执行(Windows打开Git bash)
1. git init
若对git不了解,可通过键入显示git的相关命令
2. git help git
2.复制仓库
创建一个本地仓库的克隆版本
1. git clone /path/to/repository
github仓库复制到本地
2. git clone https://github.com/QainWang/KindEditor.git
3.添加与提交
添加README.md文件
3. git add README.md
4. git commit -m "第一次提交"
4.推送到GitHub
5. git remote add origin https://github.com/QainWang/INk.git 6. git push -u origin master
master是默认分支,可改为其他分支。本地创建的其他分支默认是不可见的
5.分支
新建分支
7. git branch Ink_branch_2013_01_31
查看分支
8. git branch
切换到分支
9. git checkout Ink_branch_2013_01_31
删除分支
10. git branch -d Ink_branch_2013_01_31
6.其他常见命令
11. git status 查看文件状态
12. git log 查看提交的历史记录
13. git pull 和git push相反
设置代理
git config --global http.proxy to http://DOM/USER:[email protected]:8080/