Skip to content

Instantly share code, notes, and snippets.

@rostegg
Last active July 13, 2019 14:06
Show Gist options
  • Select an option

  • Save rostegg/1e39098d9531a8efaa2f0aa022cc51d7 to your computer and use it in GitHub Desktop.

Select an option

Save rostegg/1e39098d9531a8efaa2f0aa022cc51d7 to your computer and use it in GitHub Desktop.
Create empty branch in git project
#!/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