git使用记录

41 阅读1分钟

本地切换到指定远程分支

git checkout -b [本地分支名] [远程仓库]/[远程分支名]

或者直接checkout [远程分支名]

删除远程分支

git push origin --delete [分支]

测试merge test分支,然后test分支回滚代码,然后再merge test分支看看当前分支有没有回滚

不会回滚。merge只是merge提交,test分支回滚代码并没有新的提交,所以merge无用,效果如下:

git stash暂存

原理:栈。

  • git stash

  • git stash save [msg]

  • git stash list

  • git stash pop [stash_id]

  • git stash apply [stash_id]

  • git stash show [stash_id]

    • -p参数 查看详情

  • git stash drop [stash_id]

  • git stash clear

git diff