Git:解决写错分支的问题
小伙伴有没有遇到过 写好的代码 突然发现大佬不让在当前分支提交代码了~
如何将当前代码提交到其他分支呢?
1 如果switch的时候发现找不到你的分支需要执行
git remote update origin --prune
2 将代码提交到缓存
git stash
3 切换分支
git checkout -b 本地分支名 origin/远程分支
4 将代码拉回本地
git stash pop
5 将代码提交到新的分支 这个就略了
Git:解决写错分支的问题
小伙伴有没有遇到过 写好的代码 突然发现大佬不让在当前分支提交代码了~
如何将当前代码提交到其他分支呢?
1 如果switch的时候发现找不到你的分支需要执行
git remote update origin --prune
2 将代码提交到缓存
git stash
3 切换分支
git checkout -b 本地分支名 origin/远程分支
4 将代码拉回本地
git stash pop
5 将代码提交到新的分支 这个就略了