在项目文件夹点击右键打开Git Bash
在命令行中配置你的用户名和电子邮件:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
初始化本地仓库并提交代码
初始化 Git 仓库:
git init
添加远程仓库:
git remote add origin https://github.com/YourUsername/YourRepository.git
添加文件到暂存区:
git add .
提交更改:
git commit -m "Initial commit with project files"
推送代码到远程仓库:
git push -u origin master
通过以上步骤即可完成从本地上传一个项目至GitHub