本地代码提交到github

一、在github上创建远程仓库

 填写仓库名称、描述即可,创建成功后会自动生成URL

如果已经创建了仓库,如何修改仓库名称:

二、进入本地代码所在目录,通过命令行,将代码上传到github

git init
git add *
git commit -m '提交内容的描述'
git remote add origin 你的远程仓库的URL
git branch -M main
git push -u origin main

 参考文档:https://www.cnblogs.com/gujun1998/p/11375625.htm

posted @ 2022-04-15 15:24  zhanchenglan  阅读(44)  评论(0编辑  收藏  举报