I don't quite understand the use of git branches.

I have not quite understood the branch usage of git

.

master is definitely the remote end to push. Then, for example, I set up dev branch, and derive dev-A branch on dev . After completing development on dev-A , I merge to dev to delete dev-A , but I don"t want to release it as a major version, so I should push dev directly to far away.

or whether all three branches should be pushed to the remote end.


different companies have different development specifications, some of which produce code that deploys the master branch, and some deploy the dev branch.
if there is a development specification, follow it.
1. If the development specification requires good branch management and keeping the branches clean, you can delete bugfix, feature and other branches.
2. If the development specification requires that the development record be auditable, it is best to keep all branches.


dev is generally a development branch maintained by multiple users, which requires push to origin,. Your dev-A should be the dev that comes down from the origin and then checkout comes out to do the development. The development completes the merge to the dev (resolves the conflict), and finally the dev push is returned to origin, to delete the local dev-A

.

usually small projects with three or five people are developed in this way


first of all, make it clear that if the dev is not pushed to the remote end, it belongs to the local branch, so if many people cooperate, the dev is bound to be push.
second, the dev-A branch is your personal task, so there is no need to push to the remote server.
according to the subject, the dev branch is reserved as the current version, is bound to push, and merges into master when it needs to be released. Dev-An as a local development need, after merging into the local dev branch, the local dev branch push is completed, then the work line of dev-A has been completed, and then deleted.

Menu