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.
The mentioned link by Alex gives a good starting point to setup git on ec2. But I followed a little different approach as mentioned here. link. Direct Quotes from the page:
"Connecting with SSH without a PEM key" : So either you add the ec2 private key and add it as a entity in your ssh authentication agent or create a new ssh key for your user and use that. Steps to be followed are:
Create SSH Key
First up you will need to navigate to your .ssh folder on your local machine :
if this folder doesn’t exist use mkdir to make it.
Once in your ssh folder on your local machine which should be in /Users/yourusername/.ssh generate your key by executing the following.
When prompted enter the file name to save the key enter id_rsa_aws, when prompted to enter a password leave blank.
In your .ssh directory execute the following command and copy the output to paste later.
Now connect to you AWS instance using you PEM key
Once in
Now you go to your machine and type
If you did all the above mentioned steps correct, the only warning you might get is
That's ok. Now you can copy all your code into the clone directory, and follow the following steps:
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.
i created a GitHub gist with all the details hope it helps https://gist.github.com/eslam-mahmoud/35777e4382599438023abefc9786a382