Untergeordnete Seiten
  • Forking MP2

  Wiki Navigation

    Loading...


 Recently Updated


 Latest Releases

 MediaPortal 1.32
            Releasenews | Download
 MediaPortal 2.5
            Releasenews | Download


Table of Contents

Overview

This page is about forking the MP2 repository to be able to have a repository for making changes without write access to the official MP2 repository.

Details

You find general information about forking within the GitHub help pages. It's highly recommended to read them first if you don't know what forking means.

The configuration is done here by using TortoiseGIT, but it is similar to any other git software. The required commands for command line usage is available at the GitHub help page which has been linked to previously.

For feedback and questions the existing forum thread can be used.

Adding the fork as another remote

Assuming you already have a read-only checkout of the official MP2 repository, you can now add another remote.

[ |#] More about Remotes

A remote is a repository stored on another computer, in this case on GitHub's server. It is standard practice (and also the default when you clone a repository) to give the name origin to the remote that points to your main offsite repository (for example, your GitHub repository).

Git supports multiple remotes. This is commonly used when forking a repository.

Source: https://help.github.com/articles/fork-a-repo

If you are within the folder of you existing checkout right click and open TortoisGIT > Settings.

In the settings dialog navigate to the node Git > Remote. There you can see the existing remote origin and it's URL, which points to the official MP2 repository.

 

To add your recently created fork, you need to

  1. change the name of the Remote from origin to your GitHub username (here: chefkoch)
  2. replace the URL by the one you copy from GitHub
  3. Set Putty Key to your private key file. If you don't have a private key file follow the instructions to create one, please.
  4. and press Add New/Save

The question whether you want to fetch remote branches from the new remote, can be answered with No, because we do this manually within the next steps.

By repeating this procedure you are able to also able to add forks by others to your checkout as a remote.

Fetch branches and updates

To retrieve a list of branches of the newly added remote initially or update the list of branches of all remotes later, you need to do a Fetch. Within the Fetch-dialog you can specify which remote should be used to fetch latest updates: origin, your fork, or - all -, which fetches the updates from all remotes.

Switch branches

The Switch-dialog now lists additional to

  • your local branches (here: dev, FETCH_HEAD)
  • and official MP2 repository's branches (remotes/origin/*),
  • all branches of your fork (here: remotes/chefkoch/*)

Synchronization & Pushing commits

Within the Sync-dialog you can now easily define the remote where you wan to push changes to. This way you are able to switch to a branch from one remote, i.e. origin and push it to your own fork. After you made some changes to the branch in your fork, you can synchronize your changes the same way back to origin in case you have write access to it.

Delete not required branches within your fork

After you initially create your fork all branches existing at this time at the origin remote (MP2 official repository) are copied to yours. It's recommended that you delete initially all the branches, which you are not interested in or probably won't work with.

In case you need a deleted branch, you can get it back from the remote/origin, see Switch branches.

Deleting the branches from your fork reduces lists of branches in TortoiseGIT and on GitHub.com and thus improves the overview and transparency.

Note: Deleting the branches through the web interface (GitHub.com) might be a lot faster than doing it via TortoiseGIT.

   

 

This page has no comments.