git 拉取遠(yuǎn)程分支到本地
git checkout -b x origin/x? ? ? ? 拉取遠(yuǎn)程分支并同時(shí)創(chuàng)建對(duì)應(yīng)的本地分支
git推送本地分支到遠(yuǎn)程
git checkout -b x? ? ?創(chuàng)建本地分支
git push origin x 推送
git在錯(cuò)誤的分支修改代碼
git stash -> 切換正確分支 -> git stash pop (未add)
git log ->? 復(fù)制id? -> git reset id --soft ->重復(fù)上一條(已a(bǔ)dd或commit)
git錯(cuò)誤push
git log -> 復(fù)制id? ->?git reset id --hard -> git push -f? (錯(cuò)誤代碼及錯(cuò)誤代碼后提交的內(nèi)容全部消失)
git log -> 復(fù)制id? ->?git reset id --soft? ->? git stash? -> git push -f -> git stash pop -> 修改錯(cuò)誤代碼 ->git push (只修改不丟失)
You have not concluded your merge(MERGE_HEADexists).Please,commityour changesbeforeyou canmerge.
git merge --abort
git reset --merge