Forgetting to pull before pushing will have a consequence, that is, if you push now, there will be a conflict (the error message is probably that the online version and the local version are out of sync and need to be merged), and the push will fail.
Then you need to pull it down, merge it, and then you will be prompted for a conflict, then resolve the conflict, and then push it.
Of course, if it is a small personal project, you can also add -f to force submission after confirming that there is no problem. The consequence is that the online version is forced to be overwritten (Don’t use it like this for multi-person collaboration! Don’t use it like this for multi-person collaboration! Don’t use it like this for multi-person collaboration! )
You can pull after committing, otherwise Git is useless. When developing with multiple people, do you have to wait for others to finish writing and pull their code before you can start writing?
Forgetting to pull before pushing will have a consequence, that is, if you push now, there will be a conflict (the error message is probably that the online version and the local version are out of sync and need to be merged), and the push will fail.
Then you need to pull it down, merge it, and then you will be prompted for a conflict, then resolve the conflict, and then push it.
Of course, if it is a small personal project, you can also add -f to force submission after confirming that there is no problem. The consequence is that the online version is forced to be overwritten (Don’t use it like this for multi-person collaboration! Don’t use it like this for multi-person collaboration! Don’t use it like this for multi-person collaboration! )
You can pull after committing, otherwise Git is useless. When developing with multiple people, do you have to wait for others to finish writing and pull their code before you can start writing?
git reset
It should have been pulled after commit
git add
git commit -m ""
git pull
git push
git pull
,然后在本地merge,再git push
。git reset
git checkout