创建的默认仓库是msater
代码提交
1 | git add file //git add .添加所有 |
在本地创建仓库
1 | git init |
分支
创建新分支
git checkout -b namegit push origin localName:remoteName//本地推送到远程分支
删除分支
git branch -d namegit push :remoteBranch
查看分支
- 本地分支
git branch - 远程分支
git branch -a/-r
分支回退
- 本地回退
git log查看记录
git reset --hard commitID - 远程回退
git push HEAD --force - 重返过去
git reflog
git reset --hard versionCode - 回退一个版本
git reset --hard HEAD^
分支合并
- 从其他分支拉到当前分支
git pull origin remoteBranch[:localBranch] - 当其他分支更新后merge
git merge develop