Gitlab: Switching to Access Tokens with Your Repos

If you haven't yet switch to using Access Tokens for your repo clone. Enable your Two-Factor Authentication and create an access token under your profile. I've done this with my gitlab and keep forgetting the quick way to update the path/command.

  1. Go to https:///YOURGITLAB.com/profile/two_factor_auth
  2. Then go to https:///YOURGITLAB.com/profile/personal_access_tokens 
    • create a token with the api setting.
  3. Now switching your remote url for your git is simple. Using this command..

git remote set-url origin http://USER:TOKEN@YOURGITLAB.com/repo.git
If you have multiple origin urls you might have to remove them and add back an origin upstream and reset the origin master as the default upstream. This doesn't normally happen but I had a unique case where I had multiple urls for the origin where I was pushing to multiple repos for the same code. This probably won't be your case but I figure I might add this bit in.

Comments

Popular posts from this blog

Ng-repeat: Order a List Vertically rather Horizontal

HTML5 Audio doesn't Autoplay for Chrome on Android

NPOI Does Not Support CSV