V
V
Vladimir2020-02-22 19:47:03
git
Vladimir, 2020-02-22 19:47:03

At what stages should the code be committed?

Good evening. Interested in general and specifically in this situation. I have a lot of code on the back and I rewrite the front to react, only here there are already a bunch of files, how can I commit a bunch of files at maximum speed by functions - a new function, a new commit is acceptable. Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
DevMan, 2020-02-22
@HistoryART

there is a simple rule: more commits, less conflicts.
this does not mean that you need to commit every minute. this means that once you've written complete code, even if it's part of another task, it's worth committing.

0
0x131315, 2020-02-23
@0x131315

I usually create my own branch for a separate task, and calmly file the task in it. This avoids spoiling the master branch with unfinished tasks.
And I merge individual features of the task into commits. This allows commits to be visible, allows you to quickly look up feature implementations in the history, and allows you to safely and quickly roll back features if they are no longer needed.
Committing every line is meaningless, and committing huge chunks of code is fraught with big problems, especially with conflicts.
Daily/monthly commits are a breeze.
Git is history, every entry in it should make sense.

M
Mikhail Derkach, 2020-02-23
@skeevy

1) when you are working on a specific file/feature
2) when the feature is completed at this stage
This can lead to a large number of commits, but you can safely roll back, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question