Western USA and Canada Adventures – Part One: California Coastal Cruising

In June I took three weeks leave and travelled to the USA and Canada to visit friends who live in various cities.

My trip began on a wet Wednesday morning in Sydney with a 15 hour flight to Los Angeles, followed by a one hour flight to San Francisco. With the exception of getting quizzed about my travel plans by various airline staff and border agents both in Sydney and Los Angeles the trip up with Delta was smooth and after being upgraded to Economy Comfort quite enjoyable.

On arrival in San Francisco I was picked up by one of my best friends and as I was surprisingly awake we explored the small city area of Redwood City, pretended to be students at Stanford University and had dinner at the headquarters of Facebook where he works.

The following morning, after a small sleep in we drove from Redwood City across the hills of the San Francisco Peninsula to Half Moon Bay. Joining Highway 1 we travelled, in the fog and the rain down the coast to Santa Cruz. Continue reading

Merging a git repository from upstream when rebase won’t work

I use a lot of open source software in my research and work.

In recent months I’ve been modifying the source code of some of open source repositories to better suit my needs and I’ve contributed a few small changes back to the DeepLearning4J and the Snacktory projects.

This morning I’m starting to work on a further patch for the DeepLearning4J repository and I needed to bring my local repository up to date before committing the change. However, at some point over the past few months the DeepLearning4J repository has been rebased and my fork of it will no longer merge.
The usual approach for fixing this is to use the command:

git rebase upstream/master

However, for me this produces an error:

git encountered an error while preparing the patches to replay
these revisions:

As a result, git cannot rebase them.

Despite trying on two different computers similar errors occurred.

As I didn’t want to delete my entire repository and create a whole new fork of the upstream master this is the approach I took to fix the problem:

Backup the current master into a new branch:

git checkout -b oldMasterBackupBranch
git push origin oldMasterBackupBranch

Switch back to the master branch and replace it with the upstream master

git checkout master
git remote add upstream url/to/upstream/repo
git fetch hard upstream master
git reset --hard upstream/master

Push the updated master my github fork

git push origin master --force

This StackOverflow question helped a lot in working out this problem: Clean up a fork and restart it from the upstream