Contributing to macports using your own git fork&clone in combination with using 'port self update'

Ryan Schmidt ryandesign at macports.org
Wed Oct 27 04:07:27 UTC 2021


On Oct 23, 2021, at 05:43, Gerben Wierda wrote:

> The way I can update my ports tree using git is:
> 
> # Updating the master of my fork&clone from the master of the original:
> 
> git checkout master			# Go to branch master in my local clone
> git pull upstream master		# Update my local clone master from the master of the remote upstream
> 					# (overwrites my local master with remote github/macports/master)
> git reset --hard upstream/master	# Resets index and working tree of local clone/master from remote upstream
> git push origin master --force  	# Push local clone (~/MacPortsDev/macports-ports) master back
> 					# to my own remote fork (github/gctwnl/macports-ports)
> 					# NOTE: this closes all open pull-requests!
> 					# username: gctwnl
> 					# password: GitHub Token (in BitWarden)
> portindex				# Tell macports to use this tree and update the macports index
> 
> Is there a way to do selfupdate on the base system only without messing with the ports tree, so the base system only? Or should I just run ‘port selfupdate’ and then use the above to do it again for the ports tree?

"sudo port selfupdate" updates base using rsync and updates your ports trees using whatever method is appropriate for each of them.

If a ports tree is specified in sources.conf using an rsync:// URL, then it is updated with rsync. If it is specified using a file:/// URL and the directory is a git clone, it updates it using git commands. I can't tell you right now whether the commands MacPorts uses to update a git clone are equivalent to the ones you mentioned above or whether there are relevant differences.

If you want to update MacPorts base only and not update any ports trees, you can use "sudo port selfupdate --no-sync".



More information about the macports-users mailing list