Last active
August 14, 2016 15:13
-
-
Save CanRau/77070b02f10308356f4a12d8d690edd0 to your computer and use it in GitHub Desktop.
git notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Git create empty branch | |
*/ | |
git checkout --orphan <branchname> # branch without parents | |
git rm --cached -r . # clear the working directory | |
/** | |
* rename git branch locally and remotely | |
* @from https://gist.github.com/lttlrck/9628955 | |
*/ | |
git branch -m old_branch new_branc # Rename branch locally | |
git push origin :old_branc # Delete the old branch | |
git push --set-upstream origin new_branc # Push the new branch, set local branch to track the new remote |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment