== Initial clone == # git clone https://github.com/freebsd/freebsd-ports-graphics.git # git remote -v origin https://github.com/freebsd/freebsd-ports-graphics.git (fetch) origin https://github.com/freebsd/freebsd-ports-graphics.git (push) Change the "push" URL to the SSH access. This allows to fetch without authentication. # git remote set-url --push origin git@github.com:freebsd/freebsd-ports-graphics.git # git remote -v origin https://github.com/freebsd/freebsd-ports-graphics.git (fetch) origin git@github.com:freebsd/freebsd-ports-graphics.git (push) == Setup upstream remote == The "origin" remote repository is the xorg-dev repo. Add the official Git mirror as the "upstream" remote repository: # git remote add upstream https://github.com/freebsd/freebsd-ports.git # git remote -v origin https://github.com/freebsd/freebsd-ports-graphics.git (fetch) origin git@github.com:freebsd/freebsd-ports-graphics.git (push) upstream https://github.com/freebsd/freebsd-ports.git (fetch) upstream https://github.com/freebsd/freebsd-ports.git (push) == Case study: work on xorg-server 1.16 == Refresh your master branch: # git fetch -p --all # git merge origin/master (when on your master branch) Create your topic branch: # git checkout -b xorg-server-1.16 master Update x11-servers/xorg-server to 1.16, then commit your work: # git add x11-servers/xorg-server # git commit Push your branch: # git push -u origin xorg-server-1.16:xorg-server-1.16 Modify your work and commit the change: # git add x11-servers/xorg-server # git commit Push your update: # git push You want to fetch the modifications from another developer: # git fetch -p --all # git merge origin/xorg-server-1.16 You're ready to commit to the official Ports tree. Update your branch to the latest master: # git fetch -p --all # git merge origin/master Generate the patch # git diff origin/master...xorg-server-1.16 > xorg-server-1.16.patch