- 创建分支: git branch branchName
- 切换分支: git checkout branchName
- 创建新分支并立即切换到该分支: git checkout -b branchName
- 删除本地分支命令: git branch -d branchName
- 查看所有分支: git branch -a
- 合并分支: git merge branchName(将branchName分支并入当前分支)
The following untracked working tree files would be overwritten by
merge:
git clean -d -fx <path/filename>
冲突报错时的解决
详细
- 查看远程仓库: git remote -v
- 将本地仓库与远程仓库建立链接:git remote add origin [git url]
- 添加远程仓库:git remote add <shortname> <url>