Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
171 views
in Technique[技术] by (71.8m points)

git - Best way to add new features to a project with GitHub

I have recently launched my first GitHub open source project. Now I would like to add some new features to this project in a beta branch before merging with the master.

But what is the most efficient way of going about this?

A. Is it better to commit all the new features straight into the beta branch and then create a pull request to merge the beta branch with the master.

B. Or should I create a branch for each individual feature and create a pull request to merge those with the beta branch?

A: 
commit →↓ 
commit → beta → master
commit →↑
B: 
commit → feature1 →↓
commit → feature2 → beta → master
commit → feature3 →↑
question from:https://stackoverflow.com/questions/66063917/best-way-to-add-new-features-to-a-project-with-github

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In my job we prefer branch per feature. It is not about efficiency, but rather about coworking - it is easier to inspect smaller branches and pull requests when I review work of my coworkers.

Also, better granularity - you know that on branch X you have feature X and you can easily manage such branches.

When working alone, I do not bother about such granularity - once I finish working on batch of things, I merge. So I create longer lived branches and once I am done, I merge it - I do not review my changes in code review, so this workflow is more suitable for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...