Answer the question
In order to leave comments, you need to log in
How do you add commits?
I know that there is git-flow and other practices, but I don't really use them yet. If you need to do a lot of things in the project, then you have to throw everything off into 1 commit, because I can’t imagine how to commit every half hour for each feature. This only works well with edits.
Do you make frequent commits or "1 per workday"?
Answer the question
In order to leave comments, you need to log in
Atomically. Often. Any coherent, complete and logical piece or piece, regardless of size. It doesn't matter if I drink myself or with a team. This is a matter of habit - at first you are lazy, and you don’t seem to see the point. Over time you get used to it. And when the time comes to take advantage of the charms of atomic commits (and it comes) - rolling back a feature or returning a previously rolled back one (at the request of the client), resolving conflicts, etc. - you rejoice and thank your past self for not being too lazy.
And yet, it is very important to write adequate commit messages. No "minor fix" and the like. According to the message, it should be clearly clear when scrolling through the history what's what and why, without having to look at the diff. Ideally, also binding to issues - but this is relevant in teamwork, one is not needed.
As for brunches, it depends a lot on the project. In teamwork, this is either feature branches (git flow or your own arbitrary scheme), or each has its own branch and do whatever you want there. Here the point is primarily in pull requests, code review, CI and a stable master, which always contains working code. If you work alone, I personally am used to branching each individual feature (not a fragment, but a module, an autonomous piece of functionality). It is convenient to checkout a specific branch on the servers, test, return to the master. And this allows you to work on several features at the same time. For example, I finished one, gave it to the client for approval, and there are comments / fixes, but you are waiting for some materials. Switched to another feature and work safely in another branch. In general, it is convenient and reliable.
The idea of GIT is just in meaningful commits
Stupid automatic commits once an hour - meaningless.
So that everyone doesn’t get smart: we have a software limitation for that - commits of more than 200 lines are not accepted.
But we really have a joint work and code review.
If you work without a team - do it as a backup. But this does not require GIT.
The idea of GIT, so that you can UNDERSTAND why this or that crap was done.
And vice versa:
And to solve a certain problem, what kind of crap was done.
Why do you need git at all if you don't use it? Simple backups are fine for you.
If you need to do a lot of things in the project, then you have to throw everything into 1 commit,
--no-ff
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question