To keep our ports tree current, we must fetch and merge from the freebsd/freebsd-ports main branch. Sometimes, we have merge conflicts, and we need to fix them. Those conflicts may be related to changes specific to GhostBSD or directories that have been renamed or removed. Most of the time, those conflicts are due to changes that were not in the original freebsd/freebsd-ports.
To fetch and merge from FreeBSD ports, we need to set freebsd/freebsd-ports remote repos to our local copy of ghostbsd/ghostbsd-ports.
git clone https://github.com/ghostbsd/ghostbsd-ports.git
cd ghostbsd
git remote add freebsd https://github.com/freebsd/freebsd-ports.git
You should have this.
git remote -v
freebsd https://github.com/freebsd/freebsd-ports.git (fetch)
freebsd https://github.com/freebsd/freebsd-ports.git (push)
origin https://github.com/ghostbsd/ghostbsd-ports.git (fetch)
origin https://github.com/ghostbsd/ghostbsd-ports.git (push
Always create a new branch to commit your changes.
git checkout -b my-branch
To fetch from freebsd-ports.
git fetch freebsd
To merge freebsd-ports master.
git merge freebsd/master
If you don't have any conflict, you can push.
git push origin master
If you have code conflicts, the knowledge of maintaining ports becomes necessary. When it is code-related, it is not that hard. Most of the time, it is just a change that it cannot do. For some reason, those are easy. We need to keep our changes regarding conflicts related to changes coming from us. The most common one is related to Mk files and Makefiles.
Code conflicts always get tagged in the code, so instead of reading the verbose, I grep everything like this:
grep -R '<<<<<<< HEAD' *
It will give you all the files that have conflicts.
It has two tags in the code: the HEAD, our changes, and the freebsd/main changes. We need to fix conflicts, but we also need to ensure we don't erase our changes.
You must add, commit, and push when all the conflicts are fixed.
git add -A ; git commit ; git push origin my-branch