We all know how to deploy our own Rails projects. (If not, [read this guide][1].) But how do you handle deploying a third-party application that may require some customisation on your part?
A good example would be [Gitlab][gitlab]
Gitlab is an open source Github clone, build using Ruby on Rails. It's a nice project that uses Gitosis under the hood to manage your git repositories. There are [several][2] [good][3] installation guides available on the web, but they all assume you want to deploy gitlab verbatim - without any modification or configuration
I have also setup Gitlab, but I want to use capistrano and unicorn. I also want to tweak some configuration. In some rare cases I want to fix an annoying bug and not wait for the Gitlab team to pull it.
Doing a `git pull` on my remote server just won't cut it.
## Fork! Fork!
What I did was clone Gitlab and use the same principles describe in my [_Contributing to open source with Github_][4] to apply my own changes and merge any upstream changes when they are available.
Here's how I set everything up.
First, clone the official Gitlab repository and name it `upstream`.
That's all there is to deploying Gitlab from my own repository.
## Merging upstream changes
Now, the Gitlab crew is pushing out new features at an amazing rate. So, how do I get those new features (and the occasional bug fix) into my copy of Gitlab for deploying?
Remember how we named the official Gitlab repository `upstream` earlier? With this `fetch` we get all changes from their repository (but we don't apply them to anything yet).
Then, merge the upstream changes with your own branch.