git 命令
工作区添加到暂存区
git add .
将缓存区内容添加到本地仓库
git commit -m '描述消息' -n
拉取
git pull
上传
git push
查看分支详情
git branch -v
查看分支
git branch -a
创建分支并跟踪远程分支
git checkout --track origin/branch_name
打标签
git tag -a v1.4 -m "my version 1.4"
git push origin v1.4
缓存
git stash list
取出缓存
git stash pop stash@{index}
恢复指定的暂存工作, 暂存记录保存在list内,需要通过list索引index取出恢复
git stash pop stash@{index}
恢复指定的暂存工作, 暂存记录保存在list内,需要通过list索引index取出恢复
git stash apply stash@{index}
删除某个暂存, 暂存记录保存在list内,需要通过list索引index取出恢复
git stash drop stash@{index}
删除全部暂存
git stash clear
使用远程的tag 避免vscode不能提交
git fetch --tags -f
合并分支
git merge dev
查看分支
git status
切到某分支
git checkout (master)branch-name(分支名字)
把什么分支上的代码到主分支
git merge origin/index-swiper(分支名字) 上面两操作后 git push (说明已经将index-swiper分支上的代码 合并到主分支master上)