S
S
Sergey Burduzha2020-08-19 09:31:57
git
Sergey Burduzha, 2020-08-19 09:31:57

What is the correct philosophy for working with branches in git?

Good afternoon.
I ran into a problem and don't know how to solve it.
I am studying a new course. I looked at how the author does, then created a repository and tried to do the same himself. Only the application was styled in its own way, that is, it is not an exact copy of the author.
At some stage, I realized that I had reached a dead end.
I reviewed the lessons, and realized that I did a lot of things wrong.

Now, on a branch, I can roll back to a commit where there are no problems and create a new branch there and push this branch.
Everything else I've done will just stay up in the air, right? And it turns out that the master branch is corrupted.

Maybe there is some philosophy of working with branches?

Can you share how you work with git?

It's just that I've only worked on simple projects so far, and the master branch was enough for me.

Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitsliputsli, 2020-08-19
@serii81

master - only for stable code that is already running on production.
Keep new development in another branch (for example, dev). Once you stabilize and test the code in dev, merge it into master.
At the next stage, break development in dev into separate features, you can already see something like git-flow there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question