The Gluster Blog

Gluster blog stories provide high-level spotlights on our users all over the world

Git: Reincarnating remote “master” branch so you can easily PR to upstream

A git workflow that always give you clean pull requests 🙂

This post is for all you naughty folks out there who forked a github repo, hacked on master, and now are repenting because you have no way of clearly and efficiently sharing your hacks with the original (forked) repository.

If you had kept your master clean, you could branch it and easily issue a pull request ! 

When master is clean, you can create a clean feature branch from it and rapidly issue a pull request to the home repo.   The diagram above represents this workflow.

Okay, so what if you already gunked up your local master?  Well, then here is the approximate workflow you will follow.
Clone down your fork if you havent already: 

git clone my-fork 

Add the upstream repository as a remote:  

git remote add upstream

And finally, the magic part: 

git fetch upstream
git checkout -b remote_master upstream/master

This creates a PURE copy of the remote master that you can use to branch off of for pull requests.  

And now you can hack on “master” all you want… But, after this traumatic experience, I’m sure you will NEVER do THAT again :).


  • 03 Feb 2020
    Building a longer term focus for Gl...

    The initial rounds of conversation around the planning of content for release 8 has helped the project identify one key thing – the need to stagger out features and enhancements over multiple releases. Thus, while release 8 is unlikely to be feature heavy as previous releases, it will be the...

    Read more
  • 28 Nov 2019
    Planning ahead for Gluster releases

    In order to plan the content for upcoming releases, it is good to take a moment of pause, step back and attempt to look at the consumption of GlusterFS within large enterprises. With the enterprise architecture taking large strides towards cloud and more specifically, the hybrid cloud, continued efforts towards...

    Read more
  • 13 Nov 2019
    Announcing Gluster 7.0

    The Gluster community is pleased to announce the release of 7.0, our latest release. This is a major release that includes a range of code improvements and stability fixes along with a few features as noted below. A selection of the key features and bugs addressed are documented in this...

    Read more