How to troubleshoot an url error with “Port number ended with 'y'”?

放肆的年华 提交于 2020-01-22 12:44:19

问题


While trying to clone an already existing repository from gitlab into my local drive. I used the format

$ git clone https://github.com/libgit2/libgit2  mylibgit 

The resulting folder e.g mylibgit was found somewhere outside the XAMPP web folder (i.e htdocs), I moved it there but it's not working as supposed.

I moved it out to my desktop and got the error :

fatal: unable to access 'https://git@gitlab.com:xxxxx/yyyyyy/':Port number ended with 'y'

回答1:


For gitlab, you don't need to specify the user.
Replace it by an https url based on your GitLab account name.

cd /path/to/your/repo
git remote set-url origin https://gitlab.com/<username>/<yourProjectName.git>
git push -u origin master

Note:

trying to clone an already existing repository from gitla

This contradict "git clone https://github.com/libgit2/libgit2", since this is a GitHub url, not a GitLab one.




回答2:


Gitlab actually requires a user when using deploy tokens. For me, this was caused by mixing in ssh syntax as http://<user>:<pass>@gitlab.com:repo instead of gitlab.com/repo.




回答3:


I later found the problem, I was not typing cd /path/to/your/repo at the beginning.

I was actually typing gitlab instead of Github.

Thanks.



来源:https://stackoverflow.com/questions/45385673/how-to-troubleshoot-an-url-error-with-port-number-ended-with-y

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!