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
相关推荐
miofly12 小时前
Nous Research微调Qwen3.8-27B,宣称可剥离中国官方立场内容
开源·github
用户29914221968018 小时前
GitHub 热榜项目:周榜(2026-11-08)
人工智能·开源·github
用户29914221968018 小时前
GitHub 热榜项目:日榜(2026-11-08)
人工智能·开源·github
miofly21 小时前
GitHub 周榜趋势速报 | 2026-11-08
开源·github
miofly21 小时前
GitHub 日榜趋势速报 | 2026-11-08
开源·github
miofly2 天前
百度开源ERNIE 5.5 Flash Base,总参数280B仅激活14B
开源·github
dong_junshuai2 天前
每天一个开源项目#154 Nushell:结构化管道怎样跨过文本边界
github
Jason_gao9992 天前
Github Copilot 新手极速上手指南
人工智能·github·copilot
GitHub实测笔记2 天前
hexyl 本机实测:8MiB 转储中位 102ms、od 696ms(约 6.8×);默认双面板,NO_COLOR 下要 --color=force
github
MoRay2 天前
放弃云端 Computer Use,我用 Python 手搓了一个带“物理防呆”的本地 GUI Agent 底座
python·github