I implemented the oauth2 web flow in order to get access_token from users of my app. With the access_token, I would like to do the following actions:
- Get user informations
- Create a repo for this user
- Push code to this repo (using git push )
I already successfully get the user information(1) and create a repo(2)
The problem is I can't push code (3), I got "Unauthorized" error.
The command I run:
git remote add origin https://gitlab-ci-token<mytoken>@gitlab.com/myuser/myrepo.git
git push origin master
question from:https://stackoverflow.com/questions/42074414/gitlab-push-to-a-repository-using-access-token