Skip to content

Instantly share code, notes, and snippets.

@CanRau
Last active August 14, 2016 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CanRau/77070b02f10308356f4a12d8d690edd0 to your computer and use it in GitHub Desktop.
Save CanRau/77070b02f10308356f4a12d8d690edd0 to your computer and use it in GitHub Desktop.
git notes
/**
* 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