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
相关推荐
在水一缸2 小时前
从“反向技能“到协作革命:当开源重新定义AI编程助手
开源·github·ai编程·开发者工具·ai编程助手·ai协作·claude cowork
用户526835677903 小时前
存储运维实战:基于 Ceph Event 监听与 Python 适配器的分布式存储健康度物理声光响应架构
github
dong_junshuai3 小时前
每天一个开源项目#58 DwarfStar:2万星原生引擎,让DeepSeek V4跑在Mac上
github
ZeroNews内网穿透5 小时前
无公网 IP 打通 CI/CD:内网穿透对接 GitHub Actions 自动部署内网服务
运维·tcp/ip·ci/cd·github·远程工作·内网穿透
维基框架15 小时前
GitHub源码处理提速 一趟扫描反而更慢
人工智能·github
徐小夕16 小时前
开源!我用SQLite + DuckDB打造了一款可视化AI问数平台
前端·算法·github
码流怪侠20 小时前
SuperAGI 技术深度解析:开发者优先的开源自主 AI Agent 框架
github·agent
dong_junshuai20 小时前
每天一个开源项目#19 多源数据自动报告生成框架
github
vance0421 小时前
免费Cloudflare隧道隐藏公网IP
linux·tcp/ip·github
dong_junshuai1 天前
每天一个开源项目#56 reverse-skill:11K Stars 的安全 Agent 路由器
github