• Overview

    In english, maybe this question:

    How to push local directory to github, and create a new repository?

  • Solutions

    1. Github: Create a new repository on Github, get the https URL

      创建时保证是空的,不要添加Readme或.gitignore, 避免出现 master had recent pushes Compare & pull request

    2. Local:

      cd project
      git init
      git add *
      git commit -m "Initial"
      git remote add origin https_URL
      git remote -v
      git push -f origin master
      
  • References

  1. Adding an existing project to GitHub using the command line
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐