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
相关推荐
wflynn5 小时前
GitHub 日榜趋势速报 | 2026-10-10
开源·github
fthux6 小时前
开源小工具 Who Arrives:看看你的公网 IP、地区、时区和网络
http·开源·github
来自于狂人6 小时前
GitHub 开源趋势日报 | 2026年10月10日,告别 Mermaid 的图表设计系统
开源·github
u1301306 小时前
GitHub 热榜项目:日榜(2026-10-10)
人工智能·github
Python测试之道7 小时前
GitHub 实战课|Playwright MCP:让 AI 真的会用浏览器
人工智能·github
小陈运维8 小时前
GitHub Actions + Docker + ACR + GHCR 自动化构建与发布
github
miofly9 小时前
AI 智能体用 83% 字节精确匹配反编译完整游戏
开源·github
TunerT_TQ11 小时前
开源评测】openai/math 深度拆解:722 份 AI 数学手稿与 Lean 形式化的工程真相
github
W.A委员会11 小时前
PID自动整定与LLM调优项目使用说明(源码附文末)
自动化·github