Skip to content

Instantly share code, notes, and snippets.

@alotaiba
Created February 6, 2012 19:57
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 alotaiba/1754429 to your computer and use it in GitHub Desktop.
Save alotaiba/1754429 to your computer and use it in GitHub Desktop.
How To Create Empty Branch To Store Other Files

How To Create Empty Branch To Store Other Files

Sometimes, it's useful to create a branch that doesn't contain the main files, for example, to store other related files to the project, such as, media files, PSD, etc.

This procedure was taken from gh-pages
http://pages.github.com/

$ cd /path/to/repo
$ git symbolic-ref HEAD refs/heads/<branch_name>
$ rm .git/index
$ git clean -fdx

Now your directory is clean, you can add whatever you want to add to it.

$ echo "Hello! This is another branch that doesn't have the main files" > index.html
$ git add .
$ git commit -a -m "Committing into the media branch"

Once done, you can verify by:

$ git branch

Now you can push it to remote branch.

$ git push origin <branch_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment