邝炜瑞, Weirui Kuang's Homepage.

Git Essentials

Cover Image for Git Essentials
邝炜瑞, Weirui Kuang
邝炜瑞, Weirui Kuang

Git Essentials

Branch Out of sync

Step 1: If the branch (temporarily named dev) has modifications, first commit the modified content, if not, skip to step 2

git commit -m "fix bug"

Step 2: Switch to the master branch

git checkout master

Step 3: Pull the remote master code to the local

git pull

Step 4: Switch to the dev branch

git checkout dev

Step 5: Merge master to dev branch

git merge master

If during the merge process, it prompts that Test.java file has conflicts, manually modify this file to the content you want; if there are no conflicts, skip to step 8

Step 6: Add the modified file

git add Test.txt

Step 7: Commit the newly added file

git commit -m "merge master"

Step 8: Push the local branch code to the corresponding branch on the remote repository

git push origin dev