参考:https://www.liaoxuefeng.com/wiki/896043488029600/896067074338496
配置(git中配置,首次配置即刻,以name为例)
git config --global user.name "name"
git config --global user.email "name@example.com"
git config --list
说明:--global主要实现全局注册该账号,若是需要某个项目其他账号,只需要将--global去掉,重新配置账号即可
提交到默认主分支
1.git init =>找到要上传的地方
2.git status =>查看状态,哪些文件预备提交
3.git add 1.txt =>预备提交
4.git commit -m "" =>提交到本地git
5.git log =>查看当前日志
6.git diff =>查看更改了哪些内容
7.git reset --hard ""=>回到历史状态
8.git remote add origin https://github.com/name/v.git=>推送(v为github上新建库)
9.git push -u origin master=>提交到默认主分支
分支操作
10.git branch=>查看分支
11.git branch v2=>创建分支
12.git checkout v2=>切换分支
13.git merge=>合并分支
14.git branch -d v2 =>删除分支
15.拉取默认分支
git clone https://github.com/name/v.git
17.拉取某个分支v
git clone -b v https://github.com/name/v.git