Is this git handling of a problem on my macports-ports fork&clone OK?

Chris Jones jonesc at
Wed Feb 23 15:45:59 UTC 2022

 > git pull --rebase --autostash origin master

works pretty much just fine 99.9% of the time.

cheers Chris

* Its actually what 'port sync' does under the hood, if you have 
configured macports to work directly off a git checkout of the ports 
tree, instead of the dfault rsync tarball

** the autostash option is not available in older git versions. If the 
system git on your machine does not have it, just install MacPorts git. 
Its very useful as it automatically handles unstaged changes during a 

On 23/02/2022 2:13 pm, Kirill A. Korinsky via macports-users wrote:
> Hey,
> I'd like to share with two git aliases which I've made special for 
> MacPorts :)
> cleanup = !git branch --merged origin/HEAD | grep -v ' -> ' | grep -v 
> '^\\*' | xargs -n 1 git branch -d
> rebaseall = !git branch --no-merged | xargs -n 1 git rebase origin/HEAD
> The first one simple removed all branches which was merged into master.
> The second one rebases all branches to master.
> My usual workflow after I've opened a lot of PR to cleanup everything is:
> git rebaseall
> git checkout master
> git cleanup
> -- 
> wbr, Kirill
>> On 23. Feb 2022, at 15:10, Joshua Root <jmr at 
>> <mailto:jmr at>> wrote:
>> Gerben Wierda wrote:
>>> But I have been advised a pull is not enough, I should first do a fetch.
>> If you're referring to my private reply, what I said was that a rebase 
>> was not enough to bring master up to date with upstream/master, you 
>> have to fetch as well.
>> As per the git-pull man page:
>>       git pull runs git fetch with the given parameters and
>>        then depending on configuration options or command line flags, 
>> will call
>>        either git rebase or git merge to reconcile diverging branches.
>> Our project policy is to avoid merge commits.
>> - Josh

More information about the macports-users mailing list