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
相关推荐
怕浪猫14 小时前
全球 3D 网络地球的实时通信节点,来看看这四种交互地球,满足你对物理互联网的所有好奇
面试·架构·github
wflynn16 小时前
GitHub 今日推荐|kiri:clone3 系统调用直达容器,2.5 毫秒启动无 runc 中间层
docker·rust·kubernetes·开源·github·containers
可乐ea17 小时前
MCP 和 CLI 差 42 倍:一次 GitHub 任务的上下文成本实测
人工智能·github·工具调用·ai智能体·openrouter·mcp协议·上下文优化
逛逛GitHub18 小时前
Claude 最新模型发布 1 周了,瞧瞧外网惊艳到震撼的玩法。
github
逛逛GitHub18 小时前
最近逛 GitHub 挑了 8 个刚开源、Star 涨得挺快的项目。
github
dong_junshuai19 小时前
每天一个开源项目#158 AG-UI:让Agent事件流接上前端状态
github
吴长建先生重名了21 小时前
一个任务调度系统崩溃 Bug 从性能压测中暴露的真相
github
一条Go1 天前
Webhook 签名:钉钉、企业微信、飞书的四种算法差异
后端·架构·github
一条Go1 天前
开源新生代雷达 · 第 12 期
github
徐小夕1 天前
CADViewer-Skill:让 Agent 原生支持 DWG 解析、可视化图统计、图纸导出
前端·vue.js·github