Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sync your forked repo with original Repo in Github Desktop

Please Read this before marking as Duplicate

I know there is a solution for CMD at https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository but i asked for GitHub Desktop, If you can't answer then dont mark as Duplicate

I am new to development, I hear about Git and GitHub learn very basics then I downloaded GitHub Desktop After a while I found a great Open Source project I forked it and cloned the forked Repo in my Github Desktop. I improved some features in and and Synced my local Repo with my GitHub forked Repo, after that I did a Pull Request My addition was accepted and merged into original Repository. I added so many new features and all my Pull requests were Merged.

This is where the Sad Story Starts :( After ten days when I opened my Forked Repo on GitHub Website this is what I saw:

This branch is 12 commits behind Hipo:master

After this I searched web for many hours but can't find solution for GitHub Desktop I know there are tons of tutorial for CMD but I need to know how to sync with original Repo from Desktop Application of GitHub ?

I am new so SORRY if i asked something stupidish :) Thanks

like image 961
zsubzwary Avatar asked Sep 08 '17 07:09

zsubzwary


2 Answers

To sync the master of your fork to the master of the original repository using GitHub Desktop:

Click on the 'current branch' tab and first select 'master' as the current branch (if it's not already selected).

Click on the 'fetch origin' button.

Click on the 'current branch' tab again and click the 'choose a branch to merge into master' button at the bottom.

Button "choose a branch to merge into master"

*NOTE: Looking down this list, you will find 2 entries for every branch. Those that are prefixed with origin/ are the branches in your fork, and those prefixed with upstream/ are those in the original repository on GitHub.

Select upstream/master from this list, and this pull the changes down from the master repository to bring your local clone up to date.

Select upstream/master from this list

Once you local clone has finished pulling the updates from the master repo, push these new changes to your fork, stored on GitHub, using the push origin button on GitHub desktop.

like image 182
codestudent Avatar answered Oct 22 '22 15:10

codestudent


The popular answer didn't work for me - I kept getting a "A branch with that name already exists" error. Per this issue I found these instructions that did work:

  1. While in the default branch switch to the history tab
  2. Here you can select the branch called upstream/master and click "Merge into master"
like image 45
ow3n Avatar answered Oct 22 '22 15:10

ow3n