git 常用命令
git log (命令显示从最近到最远的提交日志)
git log --pretty=oneline(显示简易日志)
git status 查看工作区状态
git branch 命令查看本地分支,当前分支有个*符号
git branch -a 命令查看当前分支和远程分支,远程分支红色,当前分支有个*符号
git switch branch 切换分支,eg: git switch master,切换并创建分支 git switch -c dev2
git checkout -b dev origin/release/caigou_v1.0 切换并指定到远程分分支, git checkout -b 本地分支名 origin/远程分支名
git push -u origin dev:release/caigou_v1.0 将本地分支推送到远程, git push <远程主机名> <本地分支名>:<远程分支名>
[
小结
Git鼓励大量使用分支:
查看分支:git branch
创建分支:git branch <name>
切换分支:git checkout <name>或者git switch <name>
创建+切换分支:git checkout -b <name>或者git switch -c <name>
合并某分支到当前分支:git merge <name>
删除分支:git branch -d <name>
]

浙公网安备 33010602011771号