- 查询本地/远程分支
git branch
git branch -r
- 创建新分支
git branch (branchname)
- 创建并切换到新分支
git checkout -b (branchname)
= git branch (branchname) & git checkout (branchname)
- 合并分支(合并branchname分支到当前分支)
git merge (branchname)
- 本地分支(local)推送到远程(remote),远程分支不存在会自动创建
git push origin local-branch:remote-branch
- 查看状态
git status
- 添加文件到暂存区
git add (file_path)
- 提交暂存区的修改
git commit -m "some comment"