1. I pulled -f code from the remote gitlab, but the remote update could not be pulled. Later, I saw that there were more than 200 more local commits than the remote one. Is this the reason why I cannot pull the code from the remote warehouse? ? Do I have to push first before I can pull the code remotely?
Try git rebase origin/master
If you can’t pull down, it means you have no committed code locally, so you should either commit and push it up first, or git stash first and save it in the stack, then take it out at the appropriate time, and then git pull
Try to manually fetch and merge, then push it up, or even rebase it
git fetch
The local has more commit records than the remote, which means the local is newer than the remote, so it is not allowed
pull
If there is no conflict between the remote code and your local code, directly modify the local code
commit
后push
to the remote one, and then it will be consistent.If there is a conflict when pushing, you can
git fetch
git rebase origin/master
Follow the prompts to resolve conflicts.
Then
push
local code to remote