question regarding git branches

Guangyuan Yang ygy at freebsd.org
Thu Dec 10 06:14:23 UTC 2020


<jgh at freebsd.org> 于2020年12月10日周四 上午8:17写道:
>
> My question more so is around workflow. Typically, it is seen as good
> practice to commit to a new branch and then merge to the main branch. Is
> this something that is being done as part of the commit process, or are
> commits being done straight to main branch?
>
> I'm not sure I need to go into the reasoning of having multiple branches
> and what that can do insofar as community and mentoring support,
> development CI/CD pipelines, etc. If this conversation goes down this
> path, though, I would be more than happy to discuss along with others.
>

I'm not on the Git team, but just wanted to share my planned workflow:

Start by setting the FreeBSD Git remote as upstream, and my Github
repo [1] as origin:

$ git remote -v
origin  git at github.com:yzgyyang/freebsd-doc.git (fetch)
origin  git at github.com:yzgyyang/freebsd-doc.git (push)
upstream        git at gitrepo.FreeBSD.org:doc.git (fetch)
upstream        git at gitrepo.FreeBSD.org:doc.git (push)

And then the workflow for commits will be: develop on origin/dev,
(open a pull request for reviews/CI), rebase merge to origin/main,
then push to upstream/main.

This way, one would still be able to work on multiple branches and do
some collaborations and testing (just not on the project level), and
enjoy some of the CI features. For example [2], I linked the repo to
my personal Jenkins instance, so all Pull Requests will be tested.

For sure that enabling branch & merge operations will open up a lot of
new possibilities, but so far, this Git transition already helps me
heavily with the dev workflow.

[1]: https://github.com/yzgyyang/freebsd-doc
[2]: https://github.com/yzgyyang/freebsd-doc/pull/6

Best,
-- 
Guangyuan Yang
ygy at FreeBSD.org


More information about the freebsd-git mailing list