Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Improve Sync instructions and add rebase ones

After you fork the project OpenHospital (for more infos please visit How to contribute), it may happen that your fork remains behind the original development, such as new features but new dev branches as well.

In order to re-sync your fork with the original repository please follow this instructions (you need Git command line).

Note: default branch is "develop", you should keep it always clean and work only on separated branches

Note: if you have ongoing developments first read "Rebase your work" below


Sync your fork

1-- Clone your fork (you might have already cloned):

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2-- Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAMEinformatici/REPO-YOU-FORKED-FROM.git git fetch upstream (es. `git remote add isf-upstream git://github.com/informatici/OpenHospital`openhospital-core`)

3-- Updating your clone from original repo to keep up with their changes:

git checkout develop
git pull upstream masterdevelop

4-- Push back to the online fork

git push


Rebase your work

If you was working on a new feature in a private branch on your local (good 😋), please rebase your work onto the new develop

1-- Switch to your feature branch

git checkout <branch_name>

2-- Rebase your work

git rebase develop

3-- Solve any conflict on your side as if your changes are coming only now on the new code (because so it is, indeed)


If you was working directly on develop (bad 😛), please move your changes to a specific feature branch

1-- Create your feature branch

git branch my_feature_branch

2-- Reset your develop

git checkout develop
git reset --hard HEAD~3 # move develop back by 3 commits (make sure you know how many commits you need to go back)

3-- Add remote , Update your clone, and Push back to the online fork as explained above