Is this how you usually use SVN or GIt?

In all the tutorials that I see when using SVN or Git, they always show that they update individual files. I can work on 100 files in 1 day, is it normal to work with many files and in the end, just make 1 commit for all files instead of doing each file separately, which I modify?

+5
source share
9 answers

Usually you want to group commits into logically related changes, all with one commit message.

You should always specify a working code; don’t do something that you do halfway and break the assembly, which could also break someone who is trying to figure out which error introduced the error by testing older versions. Each commit should contain a small set of changes that are all related to each other.

I would not recommend modifying all your changes in a single commit per day. If you need to look at the history later, it will be difficult for you to find the necessary changes if the whole day's work is full in one commit. If you need to undo the change, it is best if you can return the whole commit, instead of selectively returning the file at a time.

, , ; , , . , .

+18

. 100 . , 5 10 , 20 .. .. . - .

+8

, , . , , , , ( ).

, . , 5, 10 , . 100 , .

+3

1 . , .

, //, .

, . , , , , .

+3

( Subversion.)

, , "". . -, , :

$ svn add header.png
A   header.png
$ svn commit index.html header.png -m "Add new header to main page."
A   header.png
M   index.html
Revision 123 committed.

, , ( ..). , :

  • . , , , .
  • ( , ?) , . , ( , , HTML -). , .

, , " misc" - . , . , : " 1, X ( A B). Rev 2, Y ( C). Rev 3, Refactor Z ( D E F G). Etc."

+2

, , .

. , .

, , , . , , , - , , -, .

, . , . , .

+2

, .. , ( , ). .

+1

. , . " ", AFAIR. :

  • - .
  • ,
  • .

, VCS - .

+1

/

If all the files you are editing are part of the same function or error, you can consider branching for each error / function. Commit the files together as a group (atomic) into each of these branches until they are completed enough to merge back into the trunk. This avoids the classic conflict of files with modifications for two functions and immediately releases only one of them.

svn / git simplify this branching style than some other version control tools.

0
source

All Articles