github使用记录

1. 首次上传本地项目到 GitHub

1.1 准备 GitHub 仓库

复制代码
登录 GitHub,点击右上角 + → New repository

输入仓库名称(建议与本地目录同名)

选择公开(Public)或私有(Private)

不要勾选 "Initialize this repository with a README"

点击创建

1.2 初始化本地仓库

复制代码
# 进入项目目录
cd /path/to/your/project

# 初始化Git仓库
git init

# 添加所有文件到暂存区
git add .

# 提交更改(添加注释)
git commit -m "Initial commit"

1.3 添加远程仓库

复制代码
# 添加远程仓库(替换username和reponame)
git remote add origin https://github.com/<username>/<reponame>.git

1.4 添加令牌访问远程仓库

复制代码
git remote set-url origin https://<token>@github.com/<username>/<reponame>.git

## token:创建好的令牌号
## 参考: https://blog.csdn.net/weixin_44415582/article/details/131503585

1.5 推送代码

复制代码
# 首次推送需要指定上游分支
git push -u origin main

如果push不上,可以添加代理端口:
参考:https://blog.csdn.net/weixin_43914200/article/details/121316043
相关推荐
用户7273744138849 小时前
JSON 转义字符到底该怎么读:几种常见场景
github
SL_staff9 小时前
考勤同步工资核算总出错?破解企业级精准自动化的三个刚性支点
mysql·github·全栈
webxin66610 小时前
汽水music自动看广告领取VIP
程序员·github
梦里寻码11 小时前
给 AI Agent 搭围栏:Monorepo 是被低估的 Agent 基础设施
前端·后端·github
穆梓兰煊12 小时前
Flutter端云协同推理架构解析
flutter·github
七牛云行业应用13 小时前
DeepSeek Harness 自定义 Skill 教程:从 SKILL.md 到可复用 Agent 工作流
算法·github
逛逛GitHub13 小时前
清华在 GitHub 上开源的 Agent 工作台,最近更新了 2.0 版本。
github
u13013015 小时前
GitHub 热榜项目:日榜(2026-10-14)
人工智能·github
誰能久伴不乏17 小时前
QT工业上位机一次「指令静默丢失」的排查
qt·docker·github
胡大伟17 小时前
麦当劳的开发者大赛:麦当劳 MCP 实测——一个藏在 inputSchema 里的参数
github