GitHub Desktop 上传流程
摘要:本文总结一下用 GitHub Desktop 上传代码的详细步骤。
步骤 1:打开 GitHub Desktop
如果没安装:
https://desktop.github.com/
步骤 2:添加项目路径
- File → Add local repository...
- 选择 某一个项目文件夹(例如 JSPChatroom)。
- 点击 Add Repository。
- 若该文件夹没有 Git,会提示创建:
- 点击 Create a repository
步骤 3:选择 Git Ignore(非常重要)
点击:
- Repository → Repository Settings → Git Ignore
根据项目选择模板:
- Python → 选择 Python ignore
- Jakarta EE → 选择 Java ignore
- Maven → 自动忽略 target/
- Gradle → 自动忽略 build/
- ASP.NET → 选择 VisualStudio ignore
- Linux Shell → 选择 None(可选)
这样就不会上传垃圾文件。
步骤 4:首次提交(Commit)
右侧 Changes 显示所有文件,填写:
- Summary:Initial commit
点击:
- Commit to main
步骤 5:推送到 GitHub(Publish)
右上角点击:
Publish repository
设置:
- 名称:建议统一格式,例如
- python-chatbot
- jakartaee-jspchatroom
- aspnet-webapi
- linux-deploy-tools
- Visibility:Public 或 Private
点击 Publish。
完成。