一、git分支使用方法
- 使用vscode打开一个在git中存储的项目,当前展示分支为master
- 新建分支(test),在分支(test)中修改代码,完成后把分支(test)提交到远程仓库
- 合并之前先把分支切换到master,重新拉取master的代码(保证当前项目是最新的),然后把分支(test)合并到当前分支(master),最后把当前分支(master)提交到远程仓库
- 删除分支(test)
二、stash命令的使用
- 缓存当前修改:git stash
- 使用缓存的stash:git stash pop
- 查看当前已有的stash:git stash list
- 移除stash:git stash drop + 名字(stash@{id})
- 查看指定stash的变化:git stash show
- 从stash创建分支:git stash branch