Talking about the use of svn and git

The author has been using svn for 4 years since he graduated, until he changed his job a few months ago, and the git used by the new unit took 1-2 months to slow down; the following is the author's management of these two codes A little experience with the tool.

svn

svn: easy to use, easy to get started, only local code and remote warehouse. It is very friendly to many projects involving non-programmers; the disadvantage is that there is no git branch management, if there is a problem with a certain version, all have to be rolled back; or in the process of developing independent functions, it is easy to be affected by other developers.

Commonly used commands in svn

Pull code: svn checkout
Update: svn update
Reset: svn revert Commit
: svn commit
View log: svn log

git

Git: It takes a long time to get started and is more complicated. The included states include: work area, cache area, local git warehouse, and remote warehouse; so it is not so friendly to non-programmers. For example, in game development, it will involve a lot of Art, planning, etc. Git is quite uncomfortable for them. Git also has the concept of branches, which is very suitable for the separate development of functions.

Commonly used commands in git

Pull branch: git checkout -b local_branch_name origin_branch_name
Switch branch: git checkout branchname
Submit the modification to the cache area: git add
Submit the contents of the cache area to the local warehouse: git commit -m "log xxx "
Submit the local warehouse to the remote warehouse : git push origin origin_branch_name
pulls the content of the remote branch to the local, and merges it: git pull -rebase
rolls back the code of the local warehouse: git reset commit-id (the commit-id can be obtained in the log)
to view the submission of the local warehouse log: git log
rolls back the local cached code to the workspace: git restore
cancels all modifications in the local workspace: git checkout.
Merge branch: git merge to_merge_branch_name (at this time, on branch a, wish to merge branch b, the command is
git merge b, after which conflicts are resolved if any.)

Look, if you just write something, you can see that git is much more complicated than svn. It is naturally difficult to get started, and you will be proficient if you spend some time!

unfinished. . . . , to be added

Guess you like

Origin blog.csdn.net/qq_41841073/article/details/131565507