1. After changing the code, GIT push has an error
Note: At this point, use git pull: Update the code, GIT will automatically merge different updates,
A. If git succeeds in automating the merge, then the GIT push operation will succeed.
B. If git fails automatically, you can use Git status to see which file merge failed, need to manually modify the conflict place, then git add git commit, and then git push
But, when this method is submitted, the merge is displayed in the submission record: *********************, and Git rebase solves the problem, as follows
2. Git branch mywork: New branch (Git branch View all branches)
At this point, the modified content is reflected in the MyWork branch.
3. Git log: View local submission
4. Rollback your submission (on the master branch, at which point the MyWork branch retains the change)
A. Git Reset: Rewind your submission
b. Git checkout: Restoring modified content
5, git Pull: Sync the latest code
6, git checkout mywork: Switch to MyWork branch
7, git rebase master: Update master, sync to MyWork branch
Note: This step, is most important, git will automatically merge Master branch and MyWork molecule at this time
A. If the automatic merge succeeds, don't worry about it.
B. If automatic merge fails, git status looks at which file merge failed, opens the file, modifies the conflict manually, executes the git add filename-> git rebase--continue
8, git log view, branch local submission
9. Git checkout master: Switch to Master branch
10. Git rebase mywork to merge mywork latest code into master
11, Git push-u origin submit. At this point, there will be no merger: *******************
12, Operation flow chart, as follows