summarize and organize git usage considerations
1. Code Submission Process
The code submission process needs to be strictly adhered to, not only to improve efficiency but also to avoid errors.
git branch Check if the current branch is in master, and if it is not in master, use git checkout master to switch to master; git pull Origin master, pulls up the latest master code; Create local branches according to the purpose (feature/bugfix/release, etc.) such as: feature/xx; bugfix/xx; release/1.0; Modify the local code, if you modify the code for a long time, at least once a day to push code to the server when the modification is complete, push to the corresponding branch and submit the merge request If the merge request has comments and needs to be modified, commit to the corresponding branch again comments Modified, cut no new, the branch will be merge to Master after modifying the branch merge to master, delete the local branch
Prohibit: Modify the code or create another branch on the branch after merge;
Prohibit: Modify others ' code;
2. Resolution for submission of conflicts
When you modify the code to complete, ready to commit, Git prompts the server code has been modified, you need to do the following steps.
git pull corresponds to the code of the branch, if the code is in conflict with the local, there will be a conflict prompt, which will indicate which files are conflicting Manual file-by-document modification of conflicts, preserving valid and modified portions after the modification is complete, git add and git commit last git push
Forbidden: Conflicting with new open branch submission