美文网首页每天一个知识点
使用 git 首次将本地代码提交至远端仓库

使用 git 首次将本地代码提交至远端仓库

作者: Sun东辉 | 来源:发表于2022-12-30 10:16 被阅读0次
  1. 初始化
    git init

2.将本地代码添加至本地仓库
git add .

  1. 提交本地仓库代码
    git commit -m 'init'

  2. 本地仓库与远程仓库关联
    git remote add origin git@github.com:xxx/demo.git

  3. 将远程仓库的文件拉取到本地
    git pull --rebase origin master

6.将本地仓库代码更新至远程仓库(如果需要,可以 -f)
git push -u origin master

相关文章

网友评论

    本文标题:使用 git 首次将本地代码提交至远端仓库

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