前提:
1.你装好了git 2.你在github上建好了仓库 3.打开了你需要上传的工程目录 4.右键选择Git Bash Here
那么开始了:1.在命令行中,输入[git init],使文件夹加入git管理; 2.输入[git add .](不要漏了“.”),将文件夹全部内容添加到git。 3.输入[git commit -m “first commit”](“git commit -m “提交信息”” ) 4.输入[git remote add origin https://github.com/shench5612390/Test.git](git remote add origin 你自己的https地址),连接你的guthub仓库。 5.输入“git push -u origin master”,上传项目到Github。这里会要求输入Github的账号密码,按要求输入就可以了。 原文地址:https://www.cnblogs.com/shenchanghui/p/7184101.html
2023年8月15日更新
…或在命令行上创建新的存储库 github官方网站上的创建指南
echo "# KMW02" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/LAIALAIA1/KMW02.git
git push -u origin main
…或从命令行推送现有存储库
git remote add origin https://github.com/LAIALAIA1/KMW02.git
git branch -M main
git push -u origin main