The developer guidelines for managing branches and forks is described here:
http://www.ohdsi.org/web/wiki/doku.php?id=development:ohdsi_github_projects_v2
@schuemie is correct about creating the upstream origin (via git remote add), however, you should be able to pull down changes to your repository using the command:
$ git fetch upstream # will fetch latest commits from the upstream repository
$ git checkout master
$ git merge upstream/master --ff-only # merges the commits from upstream/master into local master using fast-forward only
The git merge --ff-only will fail if your master branch does not ‘fast forward’ to the upstream’s master. As long as you never commit anything directly into the master branch of your fork (ie: always work off feature branches, and create pull requests from these feature branches) you shouldn’t need to do a git reset to resync your master branch to the upstream.
To visualize how PRs flow through your local repo to upstream then back into your fork:
fork repo ->
git remote add upstrream ->
git checkout -b new-feature-branch ->
git add ...
git commit....
git push origin new-feature-branch ->
Open Pull Request
Upstream Repo Accepts PR into Master
<- git fetch upstream
<- git checkout master
<- git merge upstream/master
<- your master branch now has commits from new-feature-branch
Note that you never merged your own feature branch into your fork’s master. Always get updates from the upstream master.
This process isn’t much of a headache, it becomes cumbersome when you want people from different organizations sharing a feature branch on a fork (and the people don’t have commit access to push changes to the fork).
2 ways to go about this:
- the fork owner delegates permissions to people who want to collaborate
- the main repo grants permissions to people they want to trust to create and push branches.
-Chris