3

In the web view, I see my branch. The view shows a link where I am 9 commits behind master. I assume that means 9 changes have been committed to master since I obtained my branch.

So now I am ready to start coding, using my branch. BUT, I want to make sure I have the latest code, ie I want all latest commits that have been made to master. In SVN I would simply do an "SVN UPDATE". EASY!

How do I do this using Github Desktop? I've pressed the "SYNC" icon a few times. The result is NOTHING, ie, I still see that I am 9 commits behind. In my local file system I don't see any of the files related to the 9 previous commits.

6
  • git pull from command line
    – J. Titus
    Commented Apr 13, 2017 at 20:24
  • 1
    The question was how to do this using GitHub desktop. But I'll try that. Commented Apr 13, 2017 at 20:42
  • git pull appears to do nothing. I just get a message "Already up-to-date" Commented Apr 13, 2017 at 20:47
  • @D.Kees Is the question about getting other people's commits on your branch, like svn update does? Or is it about updating a branch with changes from where you branched from, which svn update does not do? I suspect it's the second, can you provide more detail? Maybe a git status?
    – Schwern
    Commented Apr 13, 2017 at 21:21
  • Its about getting other people's commits on my branch, like svn updated. Commented Apr 13, 2017 at 22:06

3 Answers 3

6

2020 Update:

  1. Top-menu: click on Branch
  2. Select Update from master ( Ctrl+Shift+U)

Github Desktop - Update from master

1

You can sync changes by updating from upstream fork. Here's a screenshot of update button

update

You could go through this tutorial to get more info

1
0

Your question is a little ambiguous. It sounds like your local master and branch are already up to date (according to the result of git pull).

If you want to update your branch with what is on master you can do:

$ git checkout your-branch-name
$ git rebase master

This will rewind the current commits on your branch, pull in 9 commits you're missing from master, then replay the rewound commits on top of the commits from master. Note that if you want to update your remote branch after this, you'll need to force push, because it does not know about the in-between commits from master that were inserted resulting from the rebase.

If you do not want to do this, you can continue working on your branch, then when you're ready:

$ git checkout master
$ git merge your-branch-name

Which will create a merge commit in master and merge in your changes from your branch.

Although the command line is much more straightforward to accomplish this than GitHub Desktop is (IMO), if you'd rather use GitHub desktop to accomplish this task, take a look at the documentation here: https://help.github.com/desktop/guides/contributing/syncing-your-branch/

If none of this is helpful, then I'm not sure what you're trying to do.

1
  • 2
    How is it ambiguous? I just want the equivalent of SVN UPDATE.I have a branch created from master. Master is, I assume, where all other commits are MERGED to. I just want all the latest merges, ie to make sure I have everything in my branch. I don't understand why this is such a difficult question in the context of Git. Again, when using SVN, I grab a branch from the "master", a few days later some people may have committed to it. So all I want to do is "get latest" from master repo so that I have everythiing that was committed/merged to the repo. Commented Apr 14, 2017 at 21:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.