Table of Contents

Git - Fork (Upstream)

About

A fork is an entire copy of a repository.

The original repository of a fork is known as the upstream repository.

It has the same concept as a upstream branch.

Management

Add an upstream

see Git - Upstream Branch (Tracking branch)

git remote add upstream url_repo

## For instance
git remote add upstream https://github.com/user/repo

Sync

To sync your local repo with the upstream, you can

Merge

Sync a fork of a repository to keep it up-to-date with the upstream repository.

git fetch upstream
git checkout master
git merge upstream/master
Merge made by the 'recursive' strategy.
 lang/no/lang.php     | 4 +++-
 lang/no/move.txt     | 7 +++++--
 lang/no/settings.php | 6 ++++--
 lang/no/tree.txt     | 2 +-
 4 files changed, 13 insertions(+), 6 deletions(-)

Pull

If you don't have push (write) access to an upstream repository, then you can pull commits from that repository into your own fork

git checkout master
cd fork
git pull https://.../UpStreamrepo.git branch
# Example
git pull https://github.com/michitux/dokuwiki-plugin-move.git master
remote: Counting objects: 85, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 85 (delta 48), reused 41 (delta 41), pack-reused 14
Unpacking objects: 100% (85/85), done.
From https://github.com/michitux/dokuwiki-plugin-move
 * branch            master     -> FETCH_HEAD
Auto-merging lang/en/lang.php
Merge made by the 'recursive' strategy.
 README                 |  26 +++++++++-
 _test/handler.test.php |  13 ++++-
 action/rename.php      |  23 ++++-----
 admin/tree.php         |  20 +++++---
 conf/default.php       |   1 +
 conf/metadata.php      |   1 +
 helper/handler.php     |  15 ++++--
 helper/rewrite.php     |   4 +-
 images/folder_add.png  | Bin 0 -> 668 bytes
 lang/de/lang.php       |   2 +-
 lang/de/settings.php   |   3 +-
 lang/en/lang.php       |   1 +
 lang/en/settings.php   |   1 +
 lang/ja/lang.php       |   3 +-
 lang/ja/settings.php   |   3 +-
 plugin.info.txt        |   2 +-
 script/tree.js         | 129 +++++++++++++++++++++++++++++++++++++------------
 style.less             |   4 +-
 18 files changed, 185 insertions(+), 66 deletions(-)
 create mode 100644 images/folder_add.png

Documentation / Reference