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
相关推荐
Maynor在掘金8 小时前
Nano Banana 2.1 来了!21 个真实案例 + 公开提示词,这份 Awesome 合集请收好
github
miofly8 小时前
ChatGPT 账号用户可免费使用 Auto-review 双智能体审查功能
开源·github
高频因子挖掘机8 小时前
第一次补历史行情:按股票拆,还是按日期拆请求?
后端·github·api
高频因子挖掘机9 小时前
300 只股票 × 两年日 K:为什么逐只循环会变成维护灾难?
后端·github·api
Jooolin9 小时前
把 GitHub Issue 的第一轮脏活交给 AI:做一个 Issue 分诊助手
人工智能·github
u13013012 小时前
GitHub 热榜项目:日榜(2026-10-06)
人工智能·github
miofly14 小时前
Cohere推出North 2平台,主打企业AI代理可控部署
开源·github
wflynn14 小时前
GitHub 日榜趋势速报 | 2026-10-04
开源·github
wflynn14 小时前
GitHub 今日推荐|SCSKiller:游戏着色器预编译消除卡顿
开源·c#·github·nvidia·amd·directx12
miofly14 小时前
GitHub 今日推荐|lightcraft:纯 Rust 重写的 RAW 照片开发工具
rust·开源·github