How do I merge my own fork with updates from the main fork

Chris Jones jonesc at hep.phy.cam.ac.uk
Sat Aug 24 10:40:10 UTC 2019



> On 24 Aug 2019, at 11:32 am, miniupnp <miniupnp at free.fr> wrote:
> 
> Hello, 
> 
> Well, it looks like you have added 6 commits in you master branch.
> $ git status
> should tell you that.
> Merging upstream/master doesn't remove theses commits.
> It just "merges" new commits from the upstream/master branch into your current branch.
> 
> To understand what is in your branch, you should use the command :
> $ git log --graph --decorate --all 
> 
> the github graph is also useful : 
> https://github.com/gctwnl/macports-ports/network
> 
> What exactly do you want to do ?
> - have your master branch perfectly in sync with upstream/master ?
> In that case you should only commit in some other "work" branches.
> 
> - use your master branch as a "work" branch.
> In that case I advise you to rebase on the upstream master.
> 
> $ git fetch --all --prune
> $ git checkout master
> $ git rebase upstream/master
> $ git push --force origin master
> 
> 
> 
>> Le 24/08/2019 à 12:12, Gerben Wierda a écrit :
>> I’ve created my own git fork of macports to work on port updates (have submitted one pull request so far).
>> 
>> Now ether is (for me) macports/macports-ports and gctwnl/macports-ports (the one from which I’ve created a pull request).
>> 
>> It is not perfectly clear to me how I get the updates from macports/macports-ports back into my fork and be totally in sync.
>> 
>> On my local machine, I see this in my macports-ports directory:
>> 
>> Albus:macports-ports sysbh$ git remote -v
>> origin	https://github.com/gctwnl/macports-ports.git (fetch)
>> origin	https://github.com/gctwnl/macports-ports.git (push)
>> upstream	https://github.com/macports/macports-ports.git (fetch)
>> upstream	https://github.com/macports/macports-ports.git (push)
>> 

I recommend changing the above so the primary macports repo is called origin, and you call your fork something. Things tend to work more smoothly this way.

Once you have done this, assuming you have configured macports to use your checkout as its primary source, a simple

sudo port sync

Will do what is required.

Note, to see what the above is actually doing, use the debug printout option

sudo port -d sync

Chris

>> So, only my own. These are the commands I ran locally:
>> 
>>    14  git fetch upstream
>>    15  git merge upstream/master
>>    22  git push
>> 
>> But instead of being in sync, GitHub.com for gctwnl/macports-ports branch master says:
>> 
>> This branch is 6 commits ahead of macports:master.
>> 
>> So, I am obviously missing something.
>> 
>> Gerben Wierda
>> Chess and the Art of Enterprise Architecture
>> Mastering ArchiMate
>> Architecture for Real Enterprises at InfoWorld
>> On Slippery Ice at EAPJ
>> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20190824/aee06b5b/attachment.html>


More information about the macports-users mailing list