Help with git for Ghost theme updates

Hey all,

I am trying to setup a git workflow to update Ghost themes and I’m missing something. I’m pretty new to git and this might not be the best place to ask this, :slight_smile: but here it goes.

I’ve managed to create the initial setup in which I have my private github repo that holds the theme installed in my Ghost blog (with the automatic workflow to update the site when the repo is updated) and the local repo where I made initial changes to the theme (various configs).

Now I have a new version of the theme that I need to update, but it seems as if I have to go with the initial process of merging the two repo’s (local and remote, re-creating the local one from scratch as just copying new files over the local repo I wasn’t able to pull down the remote repo changes) in order to pull the configs locally, while also pushing the updated theme files to the github repo.

Is there an easier way to do this? Most probably some git flow I’m not familiar with, but could use a little help.

Thanks! :slight_smile:

1 Like

I’m not sure I fully understand if you have a local repo and a remote/Github repo that are the same/different, or?

I have a Github private repo that holds my theme and has the automatic workflow enabled (which is an awesome new feature BTW) and publishes to my Ghost(pro) site. To make changes, I have a cloned copy of that repo locally that I manipulate, commit, fetch, pull and push depending on what stage of the cycle I am in.

I used Grant Winney’s article on how to fork and then maintain my theme (I use a fork of Casper) properly. Maybe that will help?

Or are you trying to merge a local repo with another repo that aren’t the same?

I am trying to merge two local repo’s that are not the same or rather I am unsure how to bring the new theme version (which is a downloadable archive of the theme as the theme is commercial) into the local repo so that I can only push the changes into the github repo (without creating a third repo for the vanilla theme - though this seems to be the way to go if I understood the tutorial you linked right).

Or maybe this can be done through branches (another git concept I’m not really fully familiar with)? As in copy the new theme files into the local repo, git add them to the theme updates branch, then bring into theme updates the config changes from master, then merge theme updates back into master and only then push the local repo to github?

i think what I’m trying to do is this (but with local repositories):

Later edit: yes, it seems this is the procedure, creating a new local repo with the actual updated theme files, merge them into the local branch (again solving conflicts, which, unfortunately, still takes time) and then updating the remote github repository.