我已经阅读了无数的教程,但我一直在总结。这是我所拥有的:

  • 我在我的 Windows 桌面上运行 RubyMine
  • 我已经根据他们的 instructions
  • 在我的 WebFaction 托管帐户上安装了 Git
  • Git 似乎在两台机器上都运行良好

  • 这是我在做什么:
  • 在服务器上:
  • mkdir project
  • git init
  • git add .
  • git commit #==> nothing to commit

  • 在客户端:
  • 在 RubyMine 中创建新项目
  • Git init 在项目的顶层目录
  • 将更改推送到服务器 #==> failed to push some refs to...


  • 我缺少哪些步骤?

    最佳答案

    在服务器上:

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

    在客户端:
    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
    

    请注意,当您添加源时,您可以使用多种格式和模式。我建议您查看您的托管服务提供的内容。

    关于git - 如何使用 Git 对远程存储库进行初始推送?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2337281/

    10-14 14:31
    查看更多