When we plan to push codes to gitlab, you we may get this error: Updates were rejected because the remote contains work that you do hint. In this tutorial, we will introduce you how to fix it.
We may use command below to push codes.
git push -u origin master
Then, a rejected error may be reported.
How to fix this rejected error?
We should run git pull command and then push.
Here is an example:
git pull origin master
Run this code, you will update source codes in your local computer.
Then you can run git push command to upload source code to gitlab.