关于一下常用的git命令

git clone path

git pull

git push orign localBranch:originBranch  //根据本地分支新建一个远程分支,用于提mr代码。

git checkout -b mybranch origin/mybranch

git fetch -> git rebase origin/branch -> git rebase  --continue -> git rebase  --abort 

git reflog -> git reset --mixed/--hard 'x9s9ewj3'

git stash -> git stash pop //有点不安全,可能会丢失代码。如要切换分支,最好commit一下,然后将commit点reset出来。

git commit -am"commit message"

git cherry-pick 'x9s9ewj3' -> git cherry-pick --continue -> git cherry-pick --abort  //在当前分支将另一个分支的commit点拉过来

原文地址:https://www.cnblogs.com/HePandeFeng/p/12867542.html