Skip to content

8. Updating your fork

DavidAbraham082 edited this page Dec 14, 2021 · 7 revisions

Why do I need to Update my fork?

Your fork is a copy of the original repository and it doesn't automatically receive updates when changes are made.
To get the latest changes from SSWConsulting/SSW.People.Profiles into your fork, you will need to sync them manually.
Below are two ways of updating your fork with the original repository.

Method 1: Update your fork using Git

  1. Clone the fork to your local machine with git by running the below command, replacing YOUR-USERNAME with your GitHub account name.

    git clone https://github.com/YOUR-USERNAME/SSW.People.Profiles
  2. Add the main branch of SSWConsulting/SSW.People.Profiles as a remote

    cd SSW.People.Profiles  
    git remote add --track main upstream git://github.com/SSWConsulting/SSW.People.Profiles.git
  3. Pull the latest changes from SSWConsulting/SSW.People.Profiles and merge them into your fork

    git fetch upstream  
    git checkout main  
    git merge upstream/main
  4. Push your updated fork to GitHub

    git pull  
    git push
  5. Done! Your fork is now up to date

Method 2: Update your fork using GitHub

  1. Navigate to your fork of SSW.People.Profiles
    Pull requests
    Figure: Check that it has YourAccountName/SSW.People.Profiles on the left and click the "Pull requests" tab on the right

  2. Click "New pull request"

    This screen may look familiar as this is how we normally make a Pull Request from our fork back to the base Repository.
    We want to reverse this so that any changes that have been made on SSWConsulting/SSW.People.Profiles are synced with our fork.
    To do this we will create a Pull Request back into our fork.

    New pull request
    Figure: Click "New pull request"

  3. Change the base repository to your fork
    New pull request Figure: Change the base repository

  4. Compare the changes across forks
    You'll receive a message saying "There isn't anything to compare". This is because our source and destination are the same.
    Click "compare across forks" New pull request
    Figure: Click "compare across forks"

  5. Change the head repository to SSWConsulting/SSW.People.Profiles (Where we are pulling from)
    New pull request
    Figure: Change the head repository

  6. Click "Create pull request"
    New pull request
    Figure: Click "Create pull request"

  7. Add a name for the pull request and click "Create pull request"
    New pull request Figure: Add a name for the pull request and click "Create pull request"

  8. Click "Merge Pull Request"
    New pull request Figure: Click "Merge Pull Request"

  9. Click "Confirm merge"
    New pull request Figure: Click "Confirm merge"

    New pull request Figure: Pull request is merged

  10. Congratulations!! Your fork is up to date!
    New pull request Figure: The fork is up to date


Next Step: Data Structure >