I started using Visual Studio Code, and I was trying to save my test project into GitHub, but Visual Studio Code is always asking for my GitHub credentials.
I have i
The following steps walk you through how to:
**Generating SSH keys without a passphrase is unwise if your work is particularly sensitive.
OS - Fedora 28 | Editor - VS Code v1.23.0 | Repository - Git
Generate SSH keys:
ssh-keygen -t rsa -C "email@goeshere.com"
After completing the above steps, the location of your public key is shown in the terminal window. If the currently logged in user is 'bob' the location of your public key would be /home/bob/.ssh/id_rsa.pub
Copy and import public key to GitHub:
cat /home/bob/.ssh/id_rsa.pub
Copy the whole public key that is now displayed in your terminal window to the clipboard
Confirm the above steps:
ssh -T git@github.com
yes
Hi ! You've successfully authenticated, but GitHub does not provide shell access.
First commit / push without having to enter a username / password:
- touch test.txt
git add test.txt
git commit
- opens editor, enter a message and save the file. If vi is your editor, press i
once the file opens, enter a message, press esc, and then enter :x
to save changes.
git push
The only hiccup you may encounter is when you attempt to SSH to GitHub. This link will provide some assistance -
Happy hunting!
I solved a similar problem in a simple way:
git pull origin master
. Replace 'origin' with your Remote nameThat's all. I Solved the problem
apart from adding the ssh config entries above
if windows
Set-Service ssh-agent -StartupType Automatic
in powershell now the vs code should not prompt...
You should be able to set your credentials like this:
git remote set-url origin https://<USERNAME>:<PASSWORD>@bitbucket.org/path/to/repo.git
You can get the remote url like this:
git config --get remote.origin.url
In general, you can use the built-in credential storage facilities:
git config --global credential.helper store
Or, if you're on Windows, you can use their credential system:
git config --global credential.helper wincred
Or, if you're on MacOS, you can use their credential system:
git config --global credential.helper osxkeychain
The first solution is optimal in most situations.
Solve the issue by following steps.
Uninstalled softwares Vscode and git and reinstalled the same. Changed the git repository clone url from ssh to https.