git克隆文件夹未在AWS ec2 CentOS 6实例中显示

时间:2016-07-11 06:50:20

标签: git github amazon-ec2 centos6

我正在尝试将Github的公共仓库(使用通常的git clone https://github.com/<username>/<repo-name>.git命令)克隆到运行CentOS 6的AWS EC2实例中(当然以root身份登录后),因此我可以部署它。它说像

Initialized empty Git repository in /root/<repo-name>/.git/

但我尝试使用cd <repo-name>进行访问,但收到错误消息-bash: cd: <repo-folder>: No such file or directory。使用Git很长一段时间后,这是我第一次遇到这个问题。我在网上找不到任何关于此的内容。不完全是AWS EC 2服务器中的大师,但由于某些原因隐藏了文件夹?这是一种奇怪的行为,我通常不会遇到其他系统。

编辑:这是我在终端中所做的(减去确切的名字)

[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 ~]#

克隆后我的回购在哪里?

EDIT2:设置SSH并使用SSH网址而不是HTTPS网址进行克隆后,我能够正常工作。

git clone git@github.com:username/repo-name.git

我仍然想知道为什么HTTPS由于某些原因不起作用。以下是Leon要求的更多信息。

我的git版本是1.7.1

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

请求的env|grep GIT_没有输出

1 个答案:

答案 0 :(得分:0)

发现由CentOS提供支持的当前AWS EC2实例无法正常运行。我开始了一个新的,git clone工作正常,无需配置SSH来克隆它