When using git, git ls-remote
returns status code 128
while any other commands work flawlessly (push/pull/clone/etc). My repos are being managed with gitolite. I'm getting this error when trying to deploy rails app for the first time. When invoking said command by hand I get standard error like this:
fatal: The remote end hung up unexpectedly
If this was permissions/public key issue, I wouldn't be able to push/pull to/from the repo. Why does single ls-remote
command fail?
git ls-remote is one unique command allowing you to query a remote repo without having to clone/fetch it first. It will list refs/heads and refs/tags of said remote repo. It can also help resolve the actual url used by a remote repo when you have " url.
If you clone a repository, the command automatically adds that remote repository under the name “origin”.
To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. The git remote add command takes two arguments: A remote name, for example, origin.
Command #3: git ls-remote This Git command displays not only the names of remote repositories, but their reference information, including Git commit hash.
I figured it out. The problem was in repo's address. I have used git://host/repo
address instead of git@host:repo
. The latter fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With