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
相关推荐
徐小夕3 小时前
万字拆解:零向量库、无模型微调,SAG2 凭什么刷新多跳问答 SOTA
前端·vue.js·github
黑土豆3 小时前
用 drawink 给业务页面加一层画板:从网页批注到无限板书
前端·javascript·github
dong_junshuai20 小时前
每天一个开源项目#159 Plannotator:把Agent审阅做成异步消息
github
bysking1 天前
GitHub Actions 快速入门+场景实践案例
前端·后端·github
laoyeye8311 天前
手写 vLLM 分页 KV Cache(一):先从 Continuous Batching 调度器看全局
github
徐小夕1 天前
开源!我们用知识图谱重构了电子档案,AI 驱动全文智能关联
前端·vue.js·github
一条Go1 天前
开源新生代雷达 · 第 13 期
github
一条Go1 天前
Kubernetes 多集群接入:kubeconfig 只进不出
后端·架构·github
怕浪猫2 天前
全球 3D 网络地球的实时通信节点,来看看这四种交互地球,满足你对物理互联网的所有好奇
面试·架构·github
wflynn2 天前
GitHub 今日推荐|kiri:clone3 系统调用直达容器,2.5 毫秒启动无 runc 中间层
docker·rust·kubernetes·开源·github·containers