This page looks best with JavaScript enabled

How to Create a New GitHub Repo from an Existing Branch

· ☕ 1 min read

I just found a handy git/GitHub workflow in a Quora post titled “How do I create a new GitHub repository from a branch in an existing repository?". And I used it, successfully, to create a new GitHub repo for my updated Drupal 8 rendition of the Wieting Theatre’s website.

The new GitHub repo is wieting-D8-DO and it was created from the wieting branch of docker-compose-drupal.

The commands I used looked something like this:

cd ~/GitHub
git clone
cd docker-compose-drupal
git checkout master
git reset --hard origin/wieting
git checkout wieting
git remote rm origin
git remote add origin
git config "SummittDweller"
git config
git push -u origin master

And that’s a wrap… until next time. 😄

Share on

Mark A. McFate
Mark A. McFate
Digital Library Applications Developer