« first day (2925 days earlier)      last day (2019 days later) » 

8:08 PM
So I have two git branches. One which is my WordPress installation. Another which is exclusively my theme. I have my theme branch structured like: wp-content/themes/theme so when I merge it with the site branch, it should merge structures properly. However... Whenever I try to merge my theme branch into the site branch, it gives me an error like: unrelated commit history... any idea why that would occur?
How can I get my theme branch to merge into my site branch without errors?
 
 
2 hours later…
9:50 PM
@MichaelEcklund because they're unrelated
there's no common history to use as a reference
think of it as a timeline, each branch is a new timeline, and by trying to merge 2 branches you're reintegrating them
what you have, is the reintegration of the Mayan Civilisation if things had gone as they did in this timeline, and you're merging in the "the eggs, then whisk. When the consistency is right, pour into the pan and" timeline
it would be better to just use the same branch
then either use git submodules, or branch off of the master branch and send pull requests
the npm/composer route would say to use a separate repo for your theme
otherwise your branches can't be merged because they're unrelated
if they had common history, perhaps your solution would work, but then that theme branches history would involve deleting everything that isn't the theme, so it wouldn't work anyway
either all the files would be deleted on merge
or they'd come back when you updated the theme branch
there's a little more to it ofcourse, in that a git commits hash is a product of all the hashes that came before it in that timeline, so there's a cryptographic element ( for data integrity though, not as a security measure )
for that reason, if you inserted something into the chain of changesets in the past, or modified a previous commit, all the future commits hashes would change
and your git repo would no longer agree with remote git repos
you'd have to push your master up as a new differently named alternate branch
or force push, and enforce the new timeline
one other thing you could do, is add a git submodule for your theme folder, that references the same git repo but on the different branch
you'd have to move the theme files up so it wasn't in a themes/theme folder etc, and manually updated the commit being pulled in
but tbh I'd just use a monolithic repo in this case
if it's a complex project, or gets reused, composer + dedicated theme repo
 

« first day (2925 days earlier)      last day (2019 days later) »