D
D
Dima Sokolov2017-06-03 12:51:09
git
Dima Sokolov, 2017-06-03 12:51:09

How to add commits?

I would like to know how often you need to make commits? When is a single function or part of an application completed, a single task? Is it usually spelled out in any rules?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
B
Boris Korobkov, 2017-06-03
@dimka11

If we are talking about git, then it is better to do amend for every small piece (for example, a finished function), even if the whole task is not ready. In the internal history of the reflog, each action is visible separately, if necessary, you can return to it. And in the history 1 commit turns out.
In merqurial, you can't merge several commits into one. There, they usually commit less often, so that the beauty of the story does not suffer much.

D
Dmitry, 2017-06-09
@dlnsk

In my opinion, to constantly amend, as Boris suggests above, is ideologically wrong. The main purpose of git is to be able to do a quick rollback or find a commit where something broke.
It is better to make many small commits, and after testing, merge them into one using
git rebase -i

S
Seva, 2017-06-03
@Zewkin

There are a million methodologies. Some even commit by CTRL+S. There is a git flow - when there is a release in the master, development is in development, and there is a separate branch for each feature.
In short, as you like.

T
TyzhSysAdmin, 2017-06-03
@POS_troi

Here the question is in another "when to merge" and merge to do at the end of work on the "feature" / "bug", but how many times you commit along the implementation path, this is already your problem.
Although if there are weirdos in the team who fap on the beauty of the history of GIT, then there is already a different question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question