22

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

zsubzwary
  • 846
  • 7
  • 20
  • 1
    Why don't you follow https://help.github.com/articles/syncing-a-fork/ and get it done. Github Desktop is a GUI that would not provided a button for each use case that you've - rather, it will work only for generic use cases. – prabodhprakash Sep 08 '17 at 07:16
  • No matter what interface you use for Git (GUI or command line), the steps to update your fork are always the same. Therefore, check out the answers to existing questions. This one for example: https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository – jdno Sep 08 '17 at 07:45
  • Possible duplicate of [How do I update a GitHub forked repository?](https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository) – jdno Sep 08 '17 at 07:46
  • 1
    @jdno I already mentioned in question that there are ton of tutorial for CMD but I wanted answer for Desktop. – zsubzwary Sep 08 '17 at 07:56
  • 1
    @Zakawat The steps are just the same: add original repository as a remote, fetch that and then merge or rebase. It doesn't matter through which interface you do this. Read the documentation for GitHub desktop or look for more specific questions to figure out how to perform the individual tasks. As a general remark: learn how to use Git on the CLI before using any UI. It will make things like this much easier to understand and sooner or later you have to use it anyway. Trust me. – jdno Sep 08 '17 at 16:53
  • 2
    @jdno After 1 Year and 6 Months I do realize your words: “learn how to use Git on the CLI before using any UI. It will make things like this much easier to understand and sooner or later you have to use it anyway” and here I am using CLI for almost everything !! Thanks !! – zsubzwary Mar 24 '19 at 06:24

2 Answers2

42

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.

anticafe
  • 6,446
  • 9
  • 39
  • 71
codestudent
  • 521
  • 4
  • 5
3

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"
ow3n
  • 4,612
  • 4
  • 38
  • 47