美文网首页
将本地已有的项目添加到 GitHub

将本地已有的项目添加到 GitHub

作者: Natus_Vincere | 来源:发表于2017-08-08 15:34 被阅读0次
1.是否构建 本地 git
  • 如果本地没有构建 git
 - 打开终端 -> cd 到工程目录
 - git init  ( 初始化 git )
 - git add .   ( 添加所有文件到 git )
 - git commit -m "first commit"  ( 提交到本地仓库 )
  • 如果本地已经构建 git
 - git commit -m "last commit"  ( 提交到本地仓库 )
2. 在 GitHub 上新建一个空项目 , 不需要 添加ignore和readme文件
3. 复制在 GitHub 上创建好的项目地址 (https://github.com/(用户名)/(项目名).git)
4. 添加远程仓库
  - git remote add origin https://github.com/(用户名)/(项目名).git)
5.提交到远程仓库
 - git push -u origin master

相关文章

网友评论

      本文标题:将本地已有的项目添加到 GitHub

      本文链接:https://www.haomeiwen.com/subject/peitrxtx.html