[英]git cloned folder is not showing in AWS ec2 CentOS 6 instance
I'm trying to clone a public repo from Github (with the usual git clone https://github.com/<username>/<repo-name>.git
command) into an AWS EC2 instance running CentOS 6 (after logging in as root of course), so I can deploy it. 我正在尝试将来自Github的公共仓库(使用通常的git clone https://github.com/<username>/<repo-name>.git
命令) git clone https://github.com/<username>/<repo-name>.git
到运行CentOS 6的AWS EC2实例中(登录后)当然是根,所以我可以部署它。 It says something like 它说的像
Initialized empty Git repository in /root/<repo-name>/.git/
but I tried to access with with cd <repo-name>
but I get the error message -bash: cd: <repo-folder>: No such file or directory
. 但我尝试使用cd <repo-name>
但是我收到错误消息-bash: cd: <repo-folder>: No such file or directory
。 Having used Git for a very long time, this is the first time I have experience this. 使用Git很长一段时间后,这是我第一次遇到这个问题。 I couldn't find anything online about this. 我在网上找不到任何关于此的内容。 Not completely a guru in AWS EC 2 server but are the folders hidden for some reasons? 不完全是AWS EC 2服务器中的大师,但由于某些原因隐藏了文件夹? This is a weird behavior that I don't normally run into on other systems. 这是一种奇怪的行为,我通常不会在其他系统上遇到这种行为。
EDIT: here is what I did in the terminal (minus the exact names) 编辑:这是我在终端做的(减去确切的名字)
[root@AWS-ec2-server ~]# git clone https://github.com/username/repo-name.git
Initialized empty Git repository in /root/repo-name/.git/
[root@AWS-ec2-server ~]# ls
[root@AWS-ec2-server ~]# pwd
/root
[root@AWS-ec2-server ~]#
So where is my repo after I clone? 克隆后我的回购在哪里?
EDIT2: I was able to get this working after setting up SSH and clone with the SSH url instead of the HTTPS url. 编辑2:在设置SSH并使用SSH网址而不是HTTPS网址进行克隆后,我能够正常工作。
git clone git@github.com:username/repo-name.git
I still would like to know why the HTTPS doesn't work for some reasons. 我仍然想知道为什么HTTPS由于某些原因不起作用。 Here is some more info requested by Leon. 以下是Leon要求的更多信息。
My git version is 1.7.1 我的git版本是1.7.1
ls -al /root
outputs to be ls -al /root
输出
total 76
dr-xr-x---. 8 root root 4096 Jul 11 07:46 .
dr-xr-xr-x. 22 root root 4096 Jul 11 05:52 ..
-rw-------. 1 root root 5715 Jul 11 07:21 .bash_history
-rw-r--r--. 1 root root 18 May 20 2009 .bash_logout
-rw-r--r--. 1 root root 487 Jul 11 01:28 .bash_profile
-rw-r--r--. 1 root root 292 Jul 11 01:28 .bashrc
-rw-r--r--. 1 root root 100 Sep 23 2004 .cshrc
drwxr-xr-x. 3 root root 4096 Jul 11 02:05 .gem
-rw-r--r--. 1 root root 19 Jul 11 02:05 .gemrc
-rw-r--r--. 1 root root 51 Jul 11 02:13 .gitconfig
-rw-------. 1 root root 3239 Jul 11 07:38 github
-rw-r--r--. 1 root root 742 Jul 11 07:38 github.pub
drwxr-----. 3 root root 4096 Jul 11 00:36 .pki
drwxr-xr-x. 12 root root 4096 Jul 11 02:05 .rbenv
drwx------. 2 root root 4096 Jul 11 06:53 .ssh
-rw-r--r--. 1 root root 129 Dec 3 2004 .tcshrc
drwxr-xr-x. 3 root root 4096 Jul 11 07:29 test
drwxr-xr-x. 11 root root 4096 Jul 11 07:46 texter
No output for env|grep GIT_
as requested env|grep GIT_
没有输出请求
Found out that the current instance of AWS EC2 powered by CentOS is not working correctly. 发现由CentOS提供支持的当前AWS EC2实例无法正常运行。 I started a new one and git clone
works fine without needing to configure SSH to clone it 我开始了一个新的, git clone
工作正常,无需配置SSH来克隆它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.