Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Code management tool git is used to resolve code conflict management

Shulou Source: shulou.com Published: 2022-06-02 19:27:28 10月04日 Update

Now do software product projects, basically use git for code management. Compared with the people who are new to SVN,git, they do feel hurt about the use of git. The summary pit is as follows: 1. Do not understand git, do not know git local warehouse, remote warehouse command 2.SVN in Eclipse is more comfortable than git, not easy to make mistakes. But it is a general trend to use git to manage the project code, and we have to master it well. Fortunately, after many practices, the command is finally used in git cmd to solve the code synchronization management perfectly. Synchronize remote code, encounter conflict resolution 1. Method one is to overwrite the local file with a remote file. Git pull git checkout 2. Method 2, git pull, temporarily save git stash list when there is a conflict, view the list of temporary saved records, git stash temporarily save local modifications and find conflicts. After resolution, git add git commit-m "comment" git stash apply stash@ {0} releases local temporary conflict files. Resolve and submit git add git commit-m "comment" 3. Method 3, git pull found that there is a conflict prompt, there are conflict file prompts in git cmd. Pom.xml as an example: git add pom.xml git commit-m "XXX conflict resolution" git pull update code found conflict files, modified git found conflict files, and decided whether to keep git add file git commit-m "conflict resolution" git push origin Local:remote.

Tags: Conflicts files code methods management warehouses commands comments projects synchronization prompts comfort not easy general trends products general trends software products practices updates Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia MySQL Apple MariaDB