This article demonstrates how you can extend Epsilon and continue to receive source updates from the main development branch whilst also being able to commit changes to your own repository using the git version control system. The idea is to clone the Epsilon repository, make a branch and then set the remote for that branch to the master branch of your private repository. This allows you to maintain the history of Epsilon and so later on your changes can be merged into the main development branch if and when you gain committer priviliges. For the rest of this article, we shall refer to the main Epsilon project as “origin”. Specifically, we are referring to the “master” branch of Epsilon. For the extension project, we shall call it “fork”. Specifically, “forkbranch” refers to the branch name of the extension project, whilst “forkrepo” refers to the respository name of the extension project. We will assume that the “master” branch of forkrepo is used to host the forkbranch for simplicity.
If you have already set up your repository and have some content on it, you should back up all of your work before proceeding, as the following steps involve resetting your repository. The steps are as follows:
git init
git add . git commit -m "Reset repo" git remote add origin <forkrepo url> git push -u --force origin master
Your repository should now be completely clean. Here are the main steps:
git clone git://git.eclipse.org/gitroot/epsilon/org.eclipse.epsilon.git
git checkout -b forkbranch
git remote add forkrepo <fork url>
git branch --set-upstream-to=forkrepo/master
git rev-parse --abbrev-ref --symbolic-full-name @{u}
git config push.default upstream
git fetch forkrepo master
git pull --allow-unrelated-histories
git commit -m "Original, unmodified files"
git push --repo=forkrepo
git status
git config remote.pushDefault forkrepo
For more information on using Git, please refer to the documentation.