关于在亚马逊云ec2上设置git的虚拟问题 [英] Dummy questions about setting up git on amazon cloud ec2

查看:101
本文介绍了关于在亚马逊云ec2上设置git的虚拟问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,对于我可能会抛出的虚拟问题,我们深表歉意。如果你可以从这里指出我应该去哪里的方向,那将是很好的。



我完全是版本控制(以及git)和云系统的新功能。然而,它已经到了,我必须在AWS EC2实例上开发基于PHP的Web应用程序,并为未来的开发人员提供代码。



我已经成功创建了EC2实例运行PHP / MySQL并使用Elastic IP映射域。所以网站现在可以通过80端口公开访问。



我还使用 $ sudo yum install git 安装git,配置user.name和user.email



然后,转到网站的根文件夹(例如public_html)并运行' git init '创建折叠.git,然后我使用 git add。添加文件,并提交 git commit - m'初始上传'



这是正确的方法吗?将项目文件夹放在/ public_html上(可以从任何人访问)是否可以。



如果以上可以,那我应该从哪里走?
我希望在EC2上运行git服务器,允许开发人员从本地机器(例如Eclipse)进行连接,同时可以保留备份并比较代码之间的不同。



我认为什么细节给开发人员,以便他们可以连接到git服务器和在项目上工作?



我快速方向或几个关键字要做更多的研究将有所帮助。

解决方案

这里有关在amazon ec2上设置git的更多信息



允许开发人员使用你git,你只需要给他们git服务器的URL。



从网站的直接引用我' m链接到。


首先,您需要将EC2身份添加到ssh
身份验证代理,这样可以防止git的问题稍后,即
获取错误Permission denied(publickey)。当尝试执行
git push到EC2存储库。

  ssh-add path / to / privateEC2key.pem 

现在你可以继续创建git仓库在EC2
实例上。

  ssh username@hostname.com 
mkdir the_project.git
cd the_project.git
git init --bare

所以没有太多的事情在这里,我们所做的就是创建一个空库,
然后离开。现在,在本地机器上,你可以像下面的
那样做:

  cd the_project 
git init
git add。
git commit -m初始git提交消息
git remote add origin username@hostname.com:the_project.git
git config --global remote.origin.receivepackgit receive-pack
git push origin master

'git config'命令是我找到的一个修复必须能够
推送到EC2存储库。



first of all, apologize for dummy questions that I might throw here. It would be nice if you could point the directions where should I go from here.

I'm totally new to version control(as well as git) and cloud system. However, it came to the point that I have to develop php web based application on AWS EC2 instance and make codes contributable for future developers.

I did successfully create EC2 instance that run PHP/MySQL and map the domain with Elastic IP. So the website is now publicly accessible via port 80.

I also installed git using $sudo yum install git and configed user.name and user.email

I then, go to root folder of the website (e.g. public_html) and run ‘git init’ which create the fold ".git" and I then add file using "git add ." and commit "git commit -m ‘initial upload’"

Is that the right way to go? Would it be ok to have the project folder sitting on /public_html (where accessible from anyone).

If above is ok, then where should I go from here? I would like to have git server running on EC2 that allow developers to connect from their local machines (e.g. Eclipse) while being able to keep the backup and compare the different between codes.

What detail do I suppose to give developers so that they can connect to git server and working on project?

I quick direction or few keywords to do more research would help.

解决方案

look here for more information on setting up git on amazon ec2

to allow developers to use you git, you just need to give them the git server url.

Direct quote from the site i'm linking to.

"First and foremost, you need to add your EC2 identity to the ssh authentication agent. This prevents problems with git later, namely getting the error "Permission denied (publickey)." when trying to do a git push to the EC2 repository.

ssh-add path/to/privateEC2key.pem

Now you can go ahead and create the git repository on the EC2 instance.

ssh username@hostname.com 
mkdir the_project.git 
cd the_project.git 
git init --bare

So not much going on here, all we do is create an empty repository and then leave. Now, on the local machine, you do something like the following:

cd the_project 
git init
git add . 
git commit -m "Initial git commit message" 
git remote add origin username@hostname.com:the_project.git 
git config --global remote.origin.receivepack "git receive-pack" 
git push origin master

The ‘git config’ command is a fix that I found necessary to be able to push to the EC2 repository."

这篇关于关于在亚马逊云ec2上设置git的虚拟问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆