Remaining up-to-date with the original Beautiful Jekyll project

Tracking a remote branch in git
git
Author

Nishan Mann

Published

May 22, 2016

To keep my markdown knowledge updated, I decided to start posting today after a five month hiatus. My first post on ssh/sshfs hanging didn’t show up as expected, both on mobile and desktop. You can view a screenshot of how the post looked like on my mobile (on desktop it was the same) here and here. I tried various things but nothing worked. everything my previous posts looked like crap.

At that point, I decided to merge the upstream commits from daattali’s beautiful-jekyll repository hoping that would fix the issue. And it did! So here goes a lesson for myself in git. I assume you have a local clone of your repository. For me, I ran

git clone https://github.com/NahsiN/nahsin.github.io ~/nahsin.github.io

Now we add the beautiful-jekyll repository as a remote branch named jekyll_remote.

git remote add jekyll_remote https://github.com/daattali/beautiful-jekyll

Next we create and then checkout a new local branch called jekyll_local.

git branch jekyll_local
git checkout jekyll_local

Now that we are on the jekyll_local branch which you verify with

git status

we fetch the changes from jekyll_remote branch onto our local branch. I guess one can call it as ‘tracking’ the remote branch.

git fetch jekyll_remote

Now we have a local copy of the beautiful-jekyll repository and all it’s commits. Next we are going to checkout our master branch and attempt to merge the changes from jekyll_local into master.

git checkout master
git merge jekyll_local

Chances are you are going to have some merge conflicts that git cannot auto-resolve. To manually resolve conflicts, please see section 2.3 from the Pro Git book. After the conficts are resolved and a merge commit created, you can optionally delete the branch you just created

git branch -d jekyll_local

and then push the contents onto github so your site can be rebuilt

git push origin master

That’s it! For me, merging the latest changes from beautiful-jekyll repository resolved the display issues and my posts once again look nice. Good luck!