We've moved discussions to Discord

Updating Jumpstart from a github template

Joshua LeBlanc
So I made the mistake of starting off my last jumpstart project using the github templates feature. Turns out this makes merging up all the updates incredibly difficult, but I've found a solution!

I initially posted this here: https://stackoverflow.com/a/69563752/2424975, but I think it's pretty relevant to post in the forums here.

----

If you want to merge changes from a template into your project, you're going to need to fetch all of the missing commits from the template, and apply them to your own repo.

To do this, you're going to need to know the exact commit ID that you templated from, and you're going to need to know the commit ID of your first commit.
ORIGINAL_COMMIT_ID=<commit id from original repo you templated from>
YOUR_FIRST_COMMIT=<first commit id in your repo>
YOUR_BRANCH=master
Next you're going to need add the template as a remote, and fetch it.
git remote add upstream git@github.com:whatever/foo.git
git fetch upstream
And finally, you need to rebase all of the commits you're missing onto your branch
git rebase --onto ORIGINAL_COMMIT_ID YOUR_FIRST_COMMIT YOUR_BRANCH
What this is doing it basically creating a branch off of ORIGINAL_COMMIT_ID, then manually applying all of the commits on your original branch, onto this new branch.

This leaves you with what you would have had, if you had forked.

From here, you can git merge upstream/master just as if you had forked.

Note: It's important to note that this is only going to apply to one branch. If you have multiple feature branches, you'll need to perform the same steps to each one.
Notifications
You’re not receiving notifications from this thread.