I'm using Intellij 2016.2.15 on Windows to code on a nodejs project.
Everything worked fined, I could work with git easily until the git server was reformated and the ssh key changed. I used the git console to add the keys to .ssh/known_hosts, I changed the intellij git option from "built-in" to "native". I reinstalled intellij, reinstalled git, delete every temporary files. I don't know what to do to make the connection work again.
Note that if I use the git console to do "git pull" for instance it works, but if I do the same on intellij I have a "Could not read from remote repository" error.
Does anyone have an IDEA (best joke 2016) ?
Thanks in advance
You can try creating new ssh key pairs, update your public key on git and try git again on command line. This should work.
If everything then works but intellij, it's because your private key requires a passphrase. You can try using a private key without passphrase (press enter when you are prompted to enter your passphrase). This solution might not be very secure though.
Related
I have created repository on my GitHub account and successfully added my android studio project to it last week
I could push and pull with no issue but suddenly GitHub doesn't allow me to clone repository URL from android studio or push or pull the project
After hours of investigation I understood that a public key for SSH is needed
I even created that with git command lines and copied it in GitHub settings, but still have same problem.
1- Why I could work with GitHub but now I can't?
2- How to disable SSH from GitHub repository and using only HTTPS for push and fetch?
3- What is the best solution for this? I just want to push / pull the project.
** New explanation **
I did what #VonC said but no change on URLs :
By the way, I use Android Studio
I did push then get this error :
Finally I found the solution by #VonC help
I created ssh public key in my bin terminal in windows 10.
I added that to my github acount/settings.
( just need to be checked) I get authorized in bin terminal (windows):
MINGW64 /bin $ ssh -T git#github.com
Enter passphrase for key : XXX
... Hi tahadev! You've successfully
authenticated
Then
I did this command in Android Studio terminal :
"git remote set-url origin git#github.com:tahadev/Native_Form_Android.git"
Then
(By the way it is weird why it shows HTTPS url when setting for SSH)
"git remote -v"
origin https://github.com/tahadev/Native_Form_Android.git (fetch)
origin https://github.com/tahadev/Native_Form_Android.git (push)
Then I did PULL first then PUSH, in some back/force :) I finally could be able to reach my code in git from Android Studio
Thx #VonC
Android Studio terminal code and bin terminal
I find strange that the first push error message mentions "Git#github.com": only git#github.com could work, not Git.
But in any case, if you want to experiment with HTTPS without changing anything, type anywhere:
git config --global url."https://github.com/".insteadOf git#github.com:
Then check again how a push works in VSCode.
To revert:
git config --global --unset-all url.https://github.com/.insteadof
That insteadOf setting would not change a git remote -v output (still SSH there)
If would simply ensure to use an HTTPS URL when doing a git push.
I am to work on a project and I have initialized a git repo on a server. Let's suppose the URL of the server is
foo.bar
and the repo is at
/var/www/vhosts/foo.bar/httpdocs
I have created a git repo by running
git init
and then I created a .gitignore file, added whatever needed to be added, committed and from my local computer, which has ssh access to the server I have attempted to clone the repo, but I do not seem to find the correct URL or something is not set for the repo. I tried something like:
git clone https://foo.bar/httpdocs/.git
The error was
fatal: repository 'https://foo.bar/httpdocs/.git' not found
I have tried with various pathes.
FYI: I have worked with git a lot in the past, but I have never set up a repository on a server, I have always received the path of repos created by someone else. Now I have created the repo, but I cannot seem to find out what the correct URL is. I have searched a lot to find this out, but unfortunately I did not find anything which would help me. Any ideas?
If you're trying to communicate via SSH, you need the SSH link, not the HTTP(S) link:
git clone <user>#foo.bar:/var/www/vhost/foo.bar/httpdocs/.git
You need git and sshd (or openssh-server) installed on the remote server, and add your SSH key to the server, under the correct user (with ssh-copy-id, of course).
This is pramar error.
The error is in line:
cit clone https://foo.bar/httpdocs/.git
you can try:
git clone https://foo.bar/httpdocs/.git
good luck.
I'm quite new to Linux and I have some trouble using GitKraken (in Windows I use SourceTree). I want to clone a repository that is on my NAS. Unfortunately, when I try to clone it says: "Configured SSH key is invalid. Please confirm that it is properly associated with your Git provider". In Preferences>Authentication I have checked (default) Use Local SHH agent.
If I clone the rep from the terminal with git clone command it asks for the password and everything is ok.
Any suggestion?
Alex
I had the same error message in my GitKraken.
I followed carefully all the steps of "Set up SSH for Git on XXX" (Windows in my case) and managed to make it work.
https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html
Not sure it exactly applies to your case, but maybe it can guide you to the right direction.
Gerrit trigger returns
"C:\Windows\System32\config\systemprofile.ssh\id_rsa" does not exist.
However the file exists, Jenkins can clone repos using it.
This is on Windows server 2016
So first i had to move the key inside C:\ so Gerrit trigger can see it...
Second i had to restart Jenkins because even if i click save the configuration is not saved...
Im using it also on Ubuntu never had such problems there.
This is a follow up question to this question:
Android Studio can't authenticate with SVN
I got an Android project which I used in Eclipse and I just converted it to a working AS project. When using Eclipse, the SVN works fine. When using AS for some reason, every time I try to commit or update, I get a prompt asking for my user name and password and it keeps repeating itself without ever succeeding. When I press cancel I get this error:
Error:svn: E170012: When using svn+ssh:// URLs, keep in mind that the --username and --password options are ignored because authentication is performed by SSH, not Subversion
svn: E170012: Unable to connect to a repository at URL 'svn+ssh://...
svn: E170012: Can't create tunnel
svn: E720002: Can't create tunnel: The system cannot find the file specified.
What I tried until now was Uncheck follow two items
Use command line client
Use system default Subversion configuration directory
Also, I tried editing the servers file in the SVN config's folder with:
store-passwords = yes
store-ssl-client-cert-pp = yes
store-plaintext-passwords = yes
store-ssl-client-cert-pp-plaintext =yes
What else can be done?
I ended up just checking out the project again to a new folder even without setting all the things I wrote in the question and everything started working