Remember if you cannot push to repository it might be private and not accepting commits from other developer.
1. If you have 2FA enabled on the account. You need to create access token then use access token in place of password
when git prompts you to login GitLab in order to push commits.
Run the commands below to unset the global setting.
git config --global --unset http.proxy
git config --global --unset https.proxy
Then when you try to push, the git command will prompt you to login.
Use your UserName and Access Token you just generated.