1. Execute the command: git pull origin feature/theme-store –rebase, use the base operation
PS E:\wwwroot\object> git pull origin feature/theme-store --rebase
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
2. Run git stash push, storage and modification.
PS E:\wwwroot\object> git stash push
Saved working directory and index state WIP on theme-store-wangqiang-20220215: dcbbe12be Add default section content_for_layout to render section settings
PS E:\wwwroot\object>
4. Run git stash pop to apply the storage and immediately throw it away from the stack. There is a conflict between the merge code.
PS E:\wwwroot\object> git stash pop
Auto-merging platform/composer.lock
CONFLICT (content): Merge conflict in platform/composer.lock
Auto-merging platform/composer.json
CONFLICT (content): Merge conflict in platform/composer.json
The stash entry is kept in case you need it again.
PS E:\wwwroot\object> git status
On branch feature/theme-store-wangqiang-20220215
Your branch is ahead of 'origin/feature/theme-store-wangqiang-20220215' by 3 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: platform/.rnd
modified: platform/app/Http/Kernel.php
modified: platform/app/Http/Middleware/CurrentTheme.php
modified: platform/app/Providers/AppServiceProvider.php
modified: platform/app/Services/PluginService.php
modified: platform/config/app.php
modified: platform/config/modules.php
modified: platform/phpunit.xml
Unmerged paths:
(use "git restore --staged <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: platform/composer.json
both modified: platform/composer.lock
Untracked files:
(use "git add <file>..." to include in what will be committed)
platform/composer.json.BASE.json
platform/composer.json.LOCAL.json
platform/composer.json.REMOTE.json
PS E:\wwwroot\object>
5. In TortoiseGit, git submits, there is a conflicting file: platform/composer.json, platform/composer.lock. as shown in Figure 1
Figure 1
6. Right-click there is a conflict file, use “head” to resolve the conflict. as shown in Figure 2
Figure 2
7. Are you sure you want to mark the conflicting file as resolved? Click directly on the button. as shown in Figure 3
Figure 3
8. Run git status, you can see that there is no conflict
PS E:\wwwroot\object> git status
On branch feature/theme-store-wangqiang-20220215
Your branch is ahead of 'origin/feature/theme-store-wangqiang-20220215' by 3 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: platform/.rnd
modified: platform/app/Http/Kernel.php
modified: platform/app/Http/Middleware/CurrentTheme.php
modified: platform/app/Providers/AppServiceProvider.php
modified: platform/app/Services/PluginService.php
modified: platform/config/app.php
modified: platform/config/modules.php
modified: platform/phpunit.xml
PS E:\wwwroot\object>
9. Check the git log, the base operation has been completed.
10. Now you need to implement the corresponding operations of steps 2-4 in TortoiseGit. Steps 2 and 4 for reference: Using STASH in TortoiseGit
11. It is mainly the third step. After the second step is executed, the code is re-drawn, mainly to obtain the update of the upstream branch. The branch is the current local branch, and the upstream is the remote branch. as shown in Figure 4
Figure 4
12. Check the log, in line with expectations. as shown in Figure 5
Figure 5
13. If you need to keep the code of 2 branches when changing the base, you need to resolve the conflict before submitting. as shown in Figure 6
Figure 6
14. Are you sure you want to identify the conflicting file as resolved? Yes. as shown in Figure 7
Figure 7
15. Click the submit button again. as shown in Figure 8
8
16. The current commit will be empty (for example, due to conflict resolution). Skip this commit or just keep the commit message? Select Submit. as shown in Figure 9
Figure 9
17. The transformation is completed. As shown in Figure 10
Figure 10
Leave a Reply