In this tutorial I will show you how you can setup a push mirror in Gitlab. This is useful when you want to push updates that your current repository receives to a remote repository. For example I use this function to backup my repositories to their counterparts on gitlab.com to reduce the risk of a data loss.
Create an Access Token for the target repository
As the repository I want to push to runs Gitlab, I will create an Access Token, so that I don’t have to provide my login credentials to my source Gitlab instance.
After logging in on the target Gitlab repository, click on the right top corner on your Avatar and then on „Edit profile“. Now in the left menu, click on „Access Tokens“. You will now be presented the Access Token page. Here input the token name, select the expiration date, the read_repository and write_repository permissions:

Now click on „Create personal access token“. Save the access token code that is now presented on the top of the page as it will not be displayed again.
Setup the push mirroring
Now login to the source Gitlab repository and navigate to the project you wish to setup the push mirroring for. Within the menu on the left, select „Settings“ and then click on „Repository“. Enter the target repository URL. That URL must be of the format https://$USERNAME@$REPO_URL.git, where $USERNAME is the username you wish to run the push as and $REPO_URL is the URL of the target repository. Enter your created gitlab access token into the password field:

Click on „Mirror repository“. You will now see the repository in the „Mirrored repositories“ list. Now click on the refresh button to initialy synchronize your source repository to the target repository:

If everything is setup correctly, the state of „Last successful update“ should read „just now“ or a date after the update operation finished.