The question: How do I set up my global user (I am assuming) .gitconfig to use the Personal Access Token in gitlab? Due to the other constraints of my coworkers and our repository, I believe this is the only way for it to work for everyone.
E.g., this is how to use the personal access token in a cloned repository's remote config, and works:
[remote "origin"]
url = https://gitlab-ci-token:[PERSONAL ACCESS TOKEN]@gitlab.com/path/to/repostiory.git
But how do we set up our global git config so that the token is automatic? I am assuming there should be some key like
git config --global gitlab.[????somethingtoken????] [PERSONAL ACCESS TOKEN]
But for the life of me I can't find it anywhere or in any documentation. It seems like gitlab.accesstoken worked at one point in history, but they've changed their approach. neither gitlab.ci-token nor gitlab.gitlab-ci-token appears to work.
Caveats (that prevent obvious alternatives):
- This isn't just an inconvenience - we use git submodules in which the origin url needs to be included in the parent repository, and so we literally cannot use the tokenized url because it will be shared with others in .gitmodules
- We have users working from home on Windows without SSH, and so we are confined to the https repository protocol and can't switch to ssh
Thanks for your help/observations