分支管理
查看本地分支--------git branch
查看远程分支--------git branch -r
查看本地和远程分支------git branch -a
从当前分支,切换到其他分支———git checkout <branch-name>
创建并切换到新建分支———git checkout -b branch
删除分支———git branch -d <branch-name>
当前分支与指定分支合并———git merge <branch-name>
查看哪些分支已经合并到当前分支———git branch ---merged
查看哪些分支没有合并到当前分支———git branch --no-merged
查看各个分支最后一个提交对象的信息———git branch -v
删除远程分支--------git push origin --d <branch-narme>
重命名分支------git branch -m <oldbranch-name> <newbranch-name>
拉取远程分支并创建本地分支———git checkout -b 本地分支名x origin/远程分支名x
强制提交会覆盖————git push -f origin master
终止变基操作————git rebase --abort
git stash 将本地没提交的内容commit的内容不会被缓存,add的内容被缓存 并从当前分支移除 缓存结构为堆栈,先进后出
git stash list 查看本地当前缓存列表
git stash apply stash@{id} 恢复指定的stash内容 同时不会删除恢复的缓存条目
git branch -m 旧的分支名 新的分支名 重命名本地分支
git push --delete origin 旧的分支名 删除远程分支