Git question

Allan Que allan.que at gmail.com
Sat Jan 25 16:04:48 UTC 2020


On Thu, Jan 9, 2020 at 3:35 PM Gerben Wierda <gerben.wierda at rna.nl> wrote:

> Given my absolute lack of decent git skills (and it’s just too complicated
> for a fast skill increase) I have the following setup (which so far worked)
>

I'll add my 2 cents and echo that you should keep master pristine. I would
even suggest you set 'origin' as the default remote to avoid accidentally
pushing to your Github master.

$ git config branch.master.remote origin


This way, assuming you don't have rights to the official MacPorts repo, you
get a 403 error when running a git push. You also get the added benefit of
pulling updates from the correct source with just a git pull.

All changes and commits from this point go to a branch. You should have one
branch for each PR you plan to submit. When you are ready to create the PR,
use git push -u local branch-name to upload and set your Github repo as its
default remote. After the PR is merged, run git checkout master; git branch
-D branch-name; git push local :branch-name to clean up. This locally
switches to your master branch, locally force-deletes your work branch, and
deletes the work branch in your Github repo.

This is the workflow I use. It keeps my changes separate and helps me track
my updates. I can also run a port build against my changes or the original
Portfile just by checking out the appropriate branch.


Allan
-- 
Allan Que
allan.que at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20200125/982b45b3/attachment.html>


More information about the macports-users mailing list