Skip to content

Instantly share code, notes, and snippets.

@BashCloud
Created October 13, 2017 07:48
Show Gist options
  • Save BashCloud/714538694af905059b2b59d67036805c to your computer and use it in GitHub Desktop.
Save BashCloud/714538694af905059b2b59d67036805c to your computer and use it in GitHub Desktop.
Submodule a branch on git
$ git checkout -b [name_of_your_new_branch]
$ git push origin [name_of_your_new_branch]
$ git branch
$ git checkout master
$ git submodule add -b gh-pages git@github.com:blindgaenger/foobar.git _site
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: .gitmodules
# new file: _site
#
$ git commit -m "added gh-pages as submodule"
$ git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment