thisdwhitley / scrawlings

0 stars 0 forks source link

use 'subtree' for theme #5

Open thisdwhitley opened 5 years ago

thisdwhitley commented 5 years ago

In order to use subtree for my fork of the beautiful hugo theme, I did the following:

sudo dnf install git-subtree
git remote add beautifulhugo git@github.com:thisdwhitley/beautifulhugo.git
git subtree add --squash --prefix=themes/beautifulhugo beautifulhugo master
thisdwhitley commented 5 years ago

I imagine I will be doing a lot of work in the theme. Now the workflow will be:

  1. Make changes in scrawlings/themes/beautifulhugo
  2. Do the add and commit as usual, but then: git subtree push --prefix=themes/beautifulhugo/ beautifulhugo master

It is unclear what happens if I do a regular push (which just goes to origin) without pushing to the beautifulhugo remote...

REFERENCE

thisdwhitley commented 5 years ago

I still don't know what I'm doing here...

$ git subtree push --prefix=themes/beautifulhugo/ beautifulhugo master
git push using:  beautifulhugo master
To github.com:thisdwhitley/beautifulhugo.git
 ! [rejected]        30d04502088001602248d4754ef456f6f9026c6d -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:thisdwhitley/beautifulhugo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
thisdwhitley commented 5 years ago

here is what I had to do, essentially managing the theme separately and then removing what was in the "blog" repo...I don't think this is ideal:

rm -vfr themes
git commit -am "removing static directory for themes"
git subtree add --squash --prefix=themes/beautifulhugo/ beautifulhugo master