Git on Windows: fatal: Could not read from remote repository - node.js

I'm trying to use Git on Windows by using this command on prompt
git ls-remote --tags --heads git://github.com/jquery/jquery.git
And I'm receiving this error:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I was following this tutorial on Web and I'm wondering what is happening (firewall or anything else).
I'm noob with git so any help will be greatly appreciated.

my corporate firewall has blocked the git protocol.
I change git to use https protocol, so it works.
git config --global url."https://".insteadOf git://

Related

Git submodule: git#github.com: Permission denied (publickey). fatal: Could not read from remote repository

I have a problem with git submodule update --init --remote.
I receive errors: Permission denied and Failed to clone. But I added SSH keys to my github repository. I can pull, push, git clone.
I have all needed accesses.
I use OS Windows 10.
I changed in .gitmodules file url=git#github.com:xxx to url=https://github.com/xxx , but not helped.
Git will try to clone the submodule using ssh and not https. If you haven't configured your ssh key this will fail. Either change the URL from git#github.com to https://github.com in the .gitmodule file else please follow the steps which might fix the problem.
Delete the folder of the submodule from your local.
Open gitBash and run the following commands.
git submodule sync
git submodule update --init

Error while installing bower package

while trying to do bower install on node.js command promt im getting the following error
bower check-new Checking for new versions of the project dependencies..
bower ECMDERR Failed to execute "git ls-remote --tags --heads git#github.com:XXXXX/XXXX", exit
Additional error details:
ssh: connect to host github.com port 22: Bad file number
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Can some one please help me ?
Note: i'm on a corporate network.
This issue might be caused because of your corporate network, they might have blocked some ports.
Try using https instead of ssh
This is how to change:
git config --global url."https://".insteadOf git://
Well i know it kind of late but this did the trick for me.
Open .bowerrc file and set the proxy configuration.
"proxy":"http://xx.xx.xx.xx:8080",
"https-proxy":"http://xx.xx.xx.xx:8080"
and then do a run bower install command
Hope it helps !

git: 'pull' is not a git command - CentOS VPS server

I recently set up a new VPS and have installed Git via yum and wget etc. All seemed well - I can add, commit, set up a remote and push to github.
However, when I try to pull from github:
user#domain.com [~]# git pull github master
git: 'pull' is not a git command. See 'git --help'.
Did you mean this?
shell
No, I didn't mean shell, I meant pull!
Now I've googled the heck outta this - including reading several posts on Stackoverflow:
"git pull" broken
git: 'pull' is not a git command. See 'git --help'
Although most posts seem to be about Mac issues (I'm on a CentOS server), it seems to be an issue with the git exec path, which is
user#domain.com [~]# git --exec-path
/usr/local/libexec/git-core
I've tried adding a various things to .bashrc with no success.
The key thing is that when I cd down to /usr/local/ and ls -l, I can't see a libexec directory.
But if I log in as root, I can cd to /usr/local/ and see libexec/, inside which is git-core. I can also git pull as root.
So - I suspect the problem is more to do with permissions and the server setup than git itself.
I've tried
sudo chmod a+rx /usr/local/libexec
But that did nowt too...
When I ssh into another server, as an account user, I can cd down to /usr/local and see libexec - so there's something wrong with this server setup.
Any ideas gratefully received.
Solved it now - the server is using jailshell... Disabling jailshell and using 'normal' shell works a treat

Git Archive of local Git repository

I have a Git repository on a server and on the same server I have a script which needs to do a git archive of the repository.
Here's my sample git archive command which works well for remote Git repositories:
sudo git archive --remote=ssh://uname#dev.example.com/var/repo/myrepo.git --format=tar --output=src.tar development
What would I need to do/change to execute the aforementioned command on the same server so that I don't need to put all the SSH stuff? Since the command is running on the same machine as the repository, can I get away with directly accessing the Git directory.
Thanks
Use
cd .../yourcode
sudo git archive --format=tar --output=src.tar development
(it is probably unnecessary to sudo)
Sure. Just run git archive from the directory that contains the local repo, and don't specify --remote.
From the directory that is your git repository run:
git archive | bzip2 > full/relative/or/qualified/path/to/place/you/want/to/store/your/archive.tar.bz2

git error: cannot handle https

when I tried to use git clone https://xxx I got the following error
I don't handle protocol 'https'
Could anyone please help me?
full message:
dementrock#dementrock-A8Se:~$ git clone https://git.innostaa.com/innostaa.git
Cloning into innostaa...
fatal: Unable to find remote helper for 'https'
dementrock#dementrock-A8Se:~$ git --version
git version 1.7.4
Fixed this problem for Git 1.7.9 on Windows. Seemed to happen with many GIT instantiations on Windows. Had to do with the url not being properly escaped in the command line.
Solution: Put the git repository URL in single quotes 'https://.......'
Version 0.99.9i of git probably does not support https protocol.
Try to install a more recent version of git. The easiest solution would be to install it via apt-get:
$ apt-get update
$ apt-get install git
After that check that the correct version is used:
$ hash -r
$ which git
/usr/bin/git
If the returned string is not /usr/bin/git, then you have another older version of git in your PATH that is masking the more recent one. Remove it.
If you do not want to install git via apt-get or if you do not have administrator privilege on your machine, you can built it from source. You can download them from git website, and compilation should be as simple as:
$ tar -xvfj git-1.7.4.2.tar.bz2
$ cd git-1.7.4.2
$ ./configure --prefix=$HOME/install
$ make && make install
After that, you'll have to add $HOME/install/bin to your PATH.
$ hash -r
$ PATH="$HOME/install/bin:${PATH}"
$ git --version
git version 1.7.4.2
I have same problem but the reason was in my configuration of my .git. I changed config file as follows:
.git/config
enter code here[remote "heroku"]
url = git#heroku.com:rocky-bayou-4315.git
fetch = +refs/heads/*:refs/remotes/heroku/*
rocky-bayou-4315 is my heroku application that has been created by $ heroku create command.
I had the same problem while trying to "fetch upstream". I solved it by getting the Git-read only address instead of the https.
details:
I had a forked repository that needed updated from its original repo. Using github's help I added a remote upstream and tried to fetch it.
I then went to Git-hub and where I usually get the address of the the repo I clicked on the "Git-read only" button and got a new URL. I removed my past upstream and added another one with the new URL, which worked perfectly.
Just encountered this problem with git 1.7.9 on cygwin.
Using the double quotes "" to wrap the https URL can solve my problem.
eg:
git clone "https://github.com/joyent/node.git"

Resources