git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
git reset --hard HEAD # Revert (rolling back) to your current head point
# git revert using by IntellIJ IDEA
git -c core.quotepath=false rm --cached -f -- FILE_PATH
git -c core.quotepath=false checkout HEAD -- FILE_PATH
git config --global core.autocrlf input/true/false
git config --global core.safecrlf warn/true/false
-
-
Save wuliupo/388ec155d2032414500848d8d51a6007 to your computer and use it in GitHub Desktop.
rename git branch locally and remotely
从远程 master 拉分支
git -c core.quotepath=false checkout -b 新分支名字 origin/master --
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
提交之前的最后一次改动是 the_number_1234567
本地提交一次改动
git commit -m "new message"
取消刚刚提交的改动
git -c core.quotepath=false reset --soft the_number_1234567