Last active
July 13, 2019 14:06
-
-
Save rostegg/1e39098d9531a8efaa2f0aa022cc51d7 to your computer and use it in GitHub Desktop.
Create empty branch in git project
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
| #!/bin/bash | |
| # Copy to /usr/bin and don't forget to make the script executable | |
| # Usage: empty-branch <branch_name> ("assets" if empty) | |
| BRANCH=$1 | |
| if [ -z "$BRANCH" ] | |
| then | |
| BRANCH="assets" | |
| fi | |
| git checkout --orphan ${BRANCH} | |
| git rm --cached -r . | |
| rm * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment