This post gives you the commands you will need to keep your fork up to date with the master repository in GitHub.

Confession

I once confessed on Twitter that I used to delete my fork in GitHub, re-fork it and download it all again. That was my way to keep it up to date.

If you follow the steps below, or watch the video, you will see how easy it is to keep your fork up to date. In the example below and in the video I am keeping my fork of UmbracoCms up to date with the v7 branch.

Let's do this

First of all you will need to fork the project in GitHub if you haven't done that already. Make sure you have downloaded your fork to your local file system.

Make sure you are on your master branch and you don't have anything to commit.

If you are doing this for the first time, you need to make sure you add the upstream repository, you will only need to do this once, so if you come back to this post later you should be able to skip this step.

git remote add upstream https://github.com/umbraco/Umbraco-CMS.git

Now you can fetch the latest from the upstream repository

git fetch upstream

Next you can do a rebase to bring your fork up to date with the changes in the upstream repository

git rebase upstream/dev-v7

Now we have done this we need to push the changes to our git repository

git push

We can now check the status to see if we are up to date. And if we go to our fork on GitHub it should say it is up to date with master.

git status

We are now free to create a new branch for an issue we want to work on. So if I wanted to work on this umbraco issue it would be something like this.

git checkout -b U4-11385

If you would like to come back to this post again later, you can either bookmark this page, or just go to codeshare.co.uk/fork for quickness.

Here is the video in case you want to watch me show you instead:

Want to thank me?

If I've helped you out and you want to thank me, why not buy me a coffee?

About the author

Paul Seal

Umbraco MVP and .NET Web Developer from Derby (UK) who specialises in building Content Management System (CMS) websites using MVC with Umbraco as a framework. Paul is passionate about web development and programming as a whole. Apart from when he's with his wife and son, if he's not writing code, he's thinking about it or listening to a podcast about it.

Related Posts

How I use source control for my Umbraco website source code and media

In this post I share my approach to using source control for my Umbraco website source code and medi…

Read Post

Boosting your career by creating a personal brand

In this post I share the content of the talk I did at the Umbraco UK Festival 2018 about how to boos…

Read Post

How to use Donut Caching in Umbraco and MVC

In this post I show you how easy Donut Caching is to use in Umbraco and MVC. It's very clever and no…

Read Post

What are Content Apps in Umbraco v8

In this post I tell you about Content Apps in Umbraco v8 and show you what ideas I've had and what I…

Read Post