How to Create a New GitHub Repo from an Existing Branch
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 https://github.com/SummittDweller/docker-compose-drupal.git cd docker-compose-drupal git checkout master git reset --hard origin/wieting git checkout wieting git remote rm origin git remote add origin https://github.com/SummittDweller/wieting-D8-DO.git git config user.name "SummittDweller" git config user.email firstname.lastname@example.org git push -u origin master
And that’s a wrap… until next time. 😄