How do I do an initial push to a remote repository with Git?

前端 未结 6 897
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 06:37

I\'ve read through countless tutorials and I keep coming up short. Here\'s what I\'ve got:

-- I\'m running RubyMine on my Windows desktop
-- I\'ve installed Gi

6条回答
  •  日久生厌
    2020-12-07 07:22

    On server:

    mkdir my_project.git
    cd my_project.git
    git --bare init
    

    On client:

    mkdir my_project
    cd my_project
    touch .gitignore
    git init
    git add .
    git commit -m "Initial commit"
    git remote add origin youruser@yourserver.com:/path/to/my_project.git
    git push origin master
    

    Note that when you add the origin, there are several formats and schemas you could use. I recommend you see what your hosting service provides.

提交回复
热议问题