Basic Git question

Archive of historical development discussions
Discussions / Development has moved to GitHub
Post Reply
Nomis101
Posts: 7
Joined: Mon Dec 25, 2017 6:37 pm

Basic Git question

Post by Nomis101 » Mon Jun 11, 2018 10:29 pm

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

mduell
Veteran User
Posts: 6011
Joined: Sat Apr 21, 2007 8:54 pm

Re: Basic Git question

Post by mduell » Tue Jun 12, 2018 1:43 am

git pull

Nomis101
Posts: 7
Joined: Mon Dec 25, 2017 6:37 pm

Re: Basic Git question

Post by Nomis101 » Tue Jun 12, 2018 9:51 am

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. :-)

User avatar
Rodeo
HandBrake Team
Posts: 11880
Joined: Tue Mar 03, 2009 8:55 pm

Re: Basic Git question

Post by Rodeo » Tue Jun 12, 2018 2:18 pm

mduell wrote:
Tue Jun 12, 2018 1:43 am
git pull
That will pull his fork, not upstream.

User avatar
Rodeo
HandBrake Team
Posts: 11880
Joined: Tue Mar 03, 2009 8:55 pm

Re: Basic Git question

Post by Rodeo » Tue Jun 12, 2018 2:20 pm

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.

Post Reply