Skip to content

Syncing a fork

Fabien Spindler edited this page Oct 20, 2015 · 2 revisions

Syncing a fork

How to sync a fork of a repository to keep it up-to-date with the upstream repository is explained here.

We recap hereafter the instructions:

Syncing a fork of ViSP

  1. Open Terminal (for Mac and Linux users) or the command prompt (for Windows users).

  2. Change the current working directory to your local project.

  3. Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master.

    $ git fetch upstream
    remote: Counting objects: 57, done.
    remote: Compressing objects: 100% (47/47), done.
    remote: Total 57 (delta 22), reused 0 (delta 0), pack-reused 0
    Unpacking objects: 100% (57/57), done.
    From https://github.com/lagadic/visp
     * [new branch]      master     -> upstream/master
    
  4. Check out your fork's local master branch.

    $ git checkout master
    
  5. Merge the changes from upstream/master into your local master branch. This brings your fork's master branch into sync with the upstream repository, without losing your local changes.

    $ git merge upstream/master
    Updating 67afb0d..fc31b59
    Fast-forward
     modules/core/include/visp3/core/vpHistogram.h    |  52 ++++++++++---
     modules/core/include/visp3/core/vpImage.h        |  48 ++++++++++++
     modules/core/include/visp3/core/vpMath.h         | 144 +++++++++++++++++++++++++++++++++++-
     modules/core/src/tools/histogram/vpHistogram.cpp |  81 ++++++++++++++++++--
     modules/core/test/math/testMath.cpp              | 288 +++++++++++++++++++++++++++++++++++++++++++++++-
     5 files changed, 591 insertions(+), 22 deletions(-)
    
  6. To update your fork on GitHub, you must push your changes.

    $ git push