Dummy questions about setting up git on amazon cloud ec2

前端 未结 3 968
北恋
北恋 2021-02-03 11:59

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

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-03 12:31

    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."

提交回复
热议问题