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
相关推荐
用户202252215066 小时前
我在 DSH 做了个 AI 交付验收台:没有证据,就不算通过
github
前端市界6 小时前
Pro React Admin: 统一工程底座,承载多种应用...
前端·github
穆梓兰煊11 小时前
Rust 重写 AI 基础设施的工程逻辑
github
邱杰47011 小时前
数智人事系统(三):Spring Boot 3.4 骨架与配置分层
github
空空dream13 小时前
Github | 初始化空白仓库到首次推送
github
高频因子挖掘机14 小时前
A股分钟K线数据占内存:先缩小请求范围,还是换 DataFrame 工具?
后端·github·api
miofly16 小时前
Karpathy:75%人口未接触LLM,约5000人可用的内部系统已让数千智能体协作数周
开源·github
zjh102416 小时前
和 AI 一起写了个 MCP 客户端,结果最难的不是协议
github