Setup a local project from a fork repository

Published: Updated:

How to setup a local project from a fork repository on Windows 10 using WSL2.

  1. Fork the repository.

  2. Switch to local development folder:

    cd D:/localdevelopment/

  3. Clone your forked repository on the local development enviroment.

  4. Add a new upstream repository:

    git remote add upstream

  5. Verify both repositories are correct setup:

    git remote -v

  6. To sync with the original repository, assure first you are in master branch, after:

    git fetch upstream

  7. Merge the changes in your master branch:

    git merge upstream/master

Mounting the new folder on debian app:

sudo ln -s /mnt/d/localdevelopment/new-folder /var/www/new-folder

Seting up virtual host in Apache2.The conficuration file is available in /etc/apache2/sites-available.

cd /etc/apache2/sites-available

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/mysite.conf

edit mysite.conf with the correct document root and directory.Save the file. Now we need to enable the website

sudo a2ensite mysite.conf

Restrat apache2:

sudo service apache2 restart

In case you want to contribute to the original repository the steps are:

  1. Create a new branch for your changes.

  2. Make yor changes, and commit with a clear message.

  3. Push the changes to your repository.
    Create a pull request from your repository back to the original one.