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

Gerben Wierda gerben.wierda at
Sat Feb 19 12:59:29 UTC 2022

I have my own fork&clone of macports-ports in case I want to do maintenance. Getting a clean local clone for me means:

# First, do an update of macports base only (does not update the ports tree):

sudo port selfupdate --no-sync

# 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!
portindex				# Tell macports to use this tree and update the macports index

Apparently, in the past UI have accidentally done some of this as root, so this failed because parts of the macports-ports clone were owned by root.

So, I did a chown -R on that tree and tried again, but now I get

albus:macports-ports sysbh$ git pull upstream master
 * branch                    master     -> FETCH_HEAD
Updating e0a3df02c73..eca5c1226ee
error: Your local changes to the following files would be overwritten by merge:
error: The following untracked working tree files would be overwritten by merge:

So I tried to do 

git reset --hard upstream/master

and apparently this did work as another pull did nothing. But before I push that back to my own clone: have I done anything wrong? Is my local tree in order now?

Gerben Wierda (LinkedIn <>)
R&A IT Strategy <> (main site)
Book: Chess and the Art of Enterprise Architecture <>
Book: Mastering ArchiMate <>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list