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.
Connect using a standalone SSH client. Connect using Session Manager. Connect using browser-based SSH connection.
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 [email protected] 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 [email protected]: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."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With