Configure Gitlab account to Visual studio code - visual-studio-code

I am using Visual Studio Code and working locally in a repository that is in Gitlab, but every time I use the command git push origin master I get a pop window to enter my Gitlab account and password. My question is there any form to configure my Gitlab account so I do not need to enter my credentials every time?

You can refer to this answer to know how to save your username and password for git in a secure way so that it doesn't ask you again and again.
How to save username and password in Git?
Also as you mentioned about VSCode, there are many extensions that helps you with handling git but one of those which I will recommend is GitLens. As it will also let you know who changed which part of code.

Related

Netbeans JGit github password authentication deprecated,. how to reset?

I am using netbeans 8.2 to push to github but now get messages saying
You recently used a password to access the repository at XXX with git using JGit/3.6.2.201501210735-r.
Basic authentication using a password to Git is deprecated and will soon no longer work. Visit > https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more > information around suggested workarounds and removal dates.
Thanks,
The GitHub Team
How can I reset my authentication to enter a github token (https://github.com/settings/tokens) instead of my password?
I've just faced with it.
Just generate token and use inplace of password.
See also https://issues.apache.org/jira/browse/NETBEANS-5252
To reset the password, I followed the instructions at Change Git remote password used by NetBeans, and entered my new github token to the password field. Copied from that answer:
Right click your project and go to Git -> Remote -> Push... Select 'Specify Git Repository Location', update your password, click Next. It may give you error again. Close the popup and try pushing again. You should be able to push now.
For my new token, since I only want to pull and push to the project, I used the default repo options.

VS Code: Get 'Bad credentials' when using Clone Repository

I use vscode version 1.45.1. I get 'Bad credentials' when using Clone Repository. Lately I changed my username at github. That could be the reason. How do I tell vs code that?
You'll need to open up Credential Manager in Windows and delete (or edit) the Github account there:
You'll need to restart Visual Studio Code for it to prompt you to login to Github again.
Also note that you may need to revoke the OAuth connection in Github under https://github.com/settings/applications:

Eclipse Git (Egit) not accepting remote username and password

Why doesn't Egit accept username and password when fetching from remote?
These are the steps I follow:
In Git Repositories view I expand Project -> Remotes -> origin
Right click on origin -> fetch
Login mask appears; I insert User and Password
Repeat step 3 other two times
An error message appears: https://companyname.visualstudio.com/.../projectname: not authorized
Credentials are correct and I am authorized because I use them daily with any kind of git interface: TortoiseGit, SmartGit, Git Bash, ...
I did research but didn't find this problem. Also similar questions don't address this problem.
Update: I used a workaround following this guide. I created an access token from the Visual Studio Team Services account and I'm using that as password.
My git installation is using Git Credential Manager (GitHub page, Microsoft guide to GCM) to store credentials, in fact when I ran for the first time git through the interfaces I mentioned above and tried to connect to the Team Services Git repository the Microsoft Account login window popped up and that was it. Also I can tell it from runnig the command git config --list and getting credential.helper=manager.
Eclipse has the Team Explorer Everywhere plug-in installed, so it should interact with Git Credential Manager and accept the Microsoft Account credentials, but it doesn't. So this is still an open issue.
I was facing the same issue
From git side
settings-->developer settings-->Personal access tokens-->generate new token-->copy that token and use that token as password.
The way to fix this is to go to
Window->Preferences->Team->Git
And then change the HTTP client from Apache HTTP to Java Built-in HTTP
The Git clients you mention uses "native" git, and the credentials are provided transparently during the communication with the server.
Eclipse git client (jgit+egit) is full-java based, and unfortunately you can't use native git in Eclipse.
Either your Git server has user+password locally (not so enterprise-ish!) or you could use Kerberos tickets in Eclipse git; but before you run Eclipse you should do a kinit to create a ticket with your user logon, that is accessible from java process. (Normally the ticket is in your user home directory)
Example using kinit:
I m not so sure about the TFS plugin, but maybe in your case it is worth to install it and see if it helps you instead of the embedded egit, see https://msdn.microsoft.com/en-us/library/hh301122(v=vs.120).aspx
I had the same issue, not able to update the username in eclipse pop up while pushing to Git. Irrespective of username, I have provided the generated git credentials password and it worked.
Use personal access token for https. Fine graned tokens are preferred.
Refer. https://cse132.engineering.wustl.edu/files/githubEclipseAuth/githubEclipseAuth.html

First time using github and want to know command to access a repository

I just installed github in ubuntu and i don't know the commands to login with my username and password and command to access a repository and work on it
Thanks
Best way for linux is probably to give github your public key in your settings page, rather than log in as such. Then you can add a github repository to your local repository with git remote add git#github.com:<repopath> and push/pull from it with git push and git pull respectively using SSH for authentication instead of username and password.
If you don't understand any of what I've just said, I'd recommend looking at some tutorials, like this GitHub help article or Try Git.

Using Git Gui Windows - How do you save user credentials - Username and Password

I know this question has been asked before and I've been looking at this link :
https://www.kernel.org/pub/software/scm/git/docs/git-credential-store.html
I'm really really new to using Git Gui Application for Windows and Git Hub in general.
I've "fetched" an existing repository by typing in the URL for the repository from the Git Hub website in the format https://github.com/projectname.git
To push to it, I copy paste files into my local git directory and then hit f5 in Git Gui and commit/push to the origin.
However each time I want to push something - it asks me for my username and password.
The guide says to create a text file named .git-credentials with your username and password in the given format:
https://user:pass#example.com
Question:
How do I link the usage of the .git-credentials file with my Git Gui Application?...Am I using DOS? Or some Git Shell from somewhere?...
Any help would be greatly appreciated...
One solution is to use the GitHub for Windows application: it will store your credentials for you, as mentioned in this GitHub help page.
But it also adds:
If you don't want to use GitHub for Windows, you can download the helper for your OS here:
Windows Vista, 7, & 8 (.NET 4.0 required)
Unzip the file and run the git-credential-winstore.exe program inside. This will start up the helper and update your git config to use it.
Tip: The credential helper only works when you clone an HTTPS repository URL. If you use the SSH repository URL instead, SSH keys are used for authentication.
So you don't need to create yourself a .git-credentials file: the git-credential-winstore.exe program will guide you through it.