一,创建新仓库

linux环境将项目上传至github

二,在环境中安装git

  (留坑)

三,设置用户名和邮箱
    git config –global user.name '用户名'
    git config –global user.email '邮箱地址'

  拓展:查看当前用户名或邮箱

    git config user.name/email

四,创建SSH Key

  用户主目录下, .ssh目录下,看看这个目录下有没有id_rsaid_rsa.pub这两个文件,如果有,可以删除重新建或者直接略过这一步。

  创建SSH Key

  ssh-keygen -t rsa -C "邮箱地址"

五,添加Key至GitHub

  复制id_rsa.pub文件的内容,进入GitHub网站,打开Account Settings,左边选择SSH Keys,Add SSH Key,,粘贴SSH Key

六,初始化本地仓库

  在项目目录中执行

  git init

七,提交项目

  1)或在命令行上创建新的存储库

  echo "# mydemo" >> README.md

  git add README.md

  git commit -m "first commit"

  git remote add origin git@github.com:sophia1223/mydemo.git

  git push -u origin master

  2)或从命令行推送现有存储库

  git remote add origin git@github.com:sophia1223/mydemo.git

  git push -u origin master

  3)或从另一个存储库导入代码

  linux环境将项目上传至github

 

相关文章:

  • 2021-09-13
  • 2021-05-07
  • 2021-07-30
  • 2021-05-25
  • 2021-11-16
  • 2021-05-03
  • 2022-12-23
  • 2022-02-09
猜你喜欢
  • 2022-01-29
  • 2021-06-20
  • 2021-07-30
  • 2021-07-29
  • 2021-12-06
  • 2021-12-06
  • 2022-12-23
相关资源
相似解决方案