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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
从远程 master 拉分支
git -c core.quotepath=false checkout -b 新分支名字 origin/master --