[Freedombox-discuss] update fork branch

Petter Reinholdtsen pere at hungry.com
Fri Jun 25 21:19:46 BST 2021

[James Valleroy]
>> Now 'pull', which is a shorthand for 'fetch' and 'merge' the changes from 
>> 'upstream' into your local (master) branch:
>> 'git pull upstream master'
> This will likely result in a merge commit that does not exist in
> upstream/master.

One way to avoid this is using 'git pull --rebase upstream master

> I find more often what I want is to reset my local master branch to
> upstream/master.  And try to do work in feature branches / bugfix
> branches, rather than on master itself.

I too try to keep my master untouched and in sync with upstream, and
commit to separate branches.  And if I by mistake commit to master, I
create a new branch with the change 'git checkout -b new-branch-name'
before I reset my master branch back to pristine state ('git checkout
master; git reset upstream/master; git checkout .' :). 

Happy hacking
Petter Reinholdtsen

More information about the Freedombox-discuss mailing list