上传本地文件到git仓库
上传到GitHub仓库
- GitHub创建一个仓库
- 在本地文件夹,用git克隆到本地
1 | git clone git@github.com:Loki2077/hexo-anzhiyu-action.git |
- 在下载的文件中git bash here
- 复制粘贴文件到这个文件 然后添加到git
1 | git add . |
- 提交到git仓库
1 | git commit -m "本次提交说明" |
- 提交到GitHub仓库
1 | git push -u origin main |
其他语句解释
-
echo “# hexo-anzhiyu-action” >> README.md :创建一个名为 README.md 的文件,并将 “# hexo-anzhiyu-action” 写入该文件中。
-
git init :初始化一个新的 Git 仓库。
-
git commit -m “first commit” :提交暂存区中的文件到 Git 仓库,并添加一条提交信息为 “first commit” 的记录。
-
git branch -M main :将当前分支重命名为 “main”。
-
git remote add origin [email protected]:Loki2077/hexo-anzhiyu-action.git :将远程仓库的地址 “[email protected]:Loki2077/hexo-anzhiyu-action.git” 添加为名为 “origin” 的远程仓库。
-
git push -u origin main :将本地的 “main” 分支推送到名为 “origin” 的远程仓库,并设置 “origin/main” 为本地分支的上游分支。
评论