In the development process, we occasionally encounter bugs that need to be urgently repaired. At this time, we usually create a separate branch to fix the bugs, so as not to affect the existing development progress, which involves creating new branches, merging branches, tagging, etc. Operation, today I will give you a simple sharing~
1. Under the master branch, create a new branch hotfix and switch to hotfix, please confirm that all modifications of the current branch have been submitted cleanly before switching
git checkout -b hotfix
2. Make relevant changes in the hotfix branch
vi test.py
3. After modification, add commit push
git add . git comit -m "hotfix test" git push origin hotfix
4. Switch back to master
git checkout master
5. Merge hotfix to master branch
git merge hotfix
6. View the current git status
git status
7. Push the merged content to the online master branch
git push origin master
8. After patching, delete the hotfix branch
git branch -d hotfix
9. View the existing tags of the current branch
git day
10. Enter a new tag (recommended to use a tag with a note, as follows)
git tag -a v0.0.1 -m " tag version "
Hope it helps you~