Page 1 of 1

Basic Git question

Posted: Mon Jun 11, 2018 10:29 pm
by Nomis101
I know, it is a very basic question, but I already was reading a lot, asked a bunch of peoples and I still can not solve it.
I have made a branch of HandBrake some time ago. In the meantime it tells me "This branch is 224 commits behind HandBrake:master". Yes, sure it is, but how can I bring this branch up to date with current HandBrake master? I clicked on nearly every button, used every Terminal command I found in the internet, but it is still not up to date. Currently I'm using the GitHub Desktop App, because it seems more intuitive than all this tricky commands.

https://github.com/Nomis101/HandBrake

Re: Basic Git question

Posted: Tue Jun 12, 2018 1:43 am
by mduell
git pull

Re: Basic Git question

Posted: Tue Jun 12, 2018 9:51 am
by Nomis101
Thanks.
$ git pull
Already up to date.
But it was working by executing
$ git pull https://github.com/HandBrake/HandBrake
Than I've opened GitHub Desktop and clicked on "Fetch original". Now it is up to date. :-)

Re: Basic Git question

Posted: Tue Jun 12, 2018 2:18 pm
by Deleted User 11865
mduell wrote: Tue Jun 12, 2018 1:43 amgit pull
That will pull his fork, not upstream.

Re: Basic Git question

Posted: Tue Jun 12, 2018 2:20 pm
by Deleted User 11865
https://help.github.com/articles/adding-a-remote/

Note that in the example, they call the new remote "origin" but that's the default remote name for git, so in your local repository, origin will already be set to https://github.com/your/fork

I usually name the remote of the original project "upstream" instead.

Once the remote is added, you can do e.g.

Code: Select all

git checkout master && git pull upstream master
…to update your fork's master branch with the latest changes from upstream's (i.e. HandBrake's) master branch.