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
相关推荐
TunerT_TQ3 分钟前
Microsoft |Playwright CLI 源码静态审阅:从 5 个文件看浏览器自动化工具的工程边界
后端·开源·github
JavaGuide1 小时前
84.5K+ Star!这个开源编程 Agent 控制台,能统一管理 Codex、Claude Code,DeepSeek Harness 也能接入
后端·github
量化小c2 小时前
一行代码查 BTCUSDT 和 AAPL 最新价?QuantDash 统一多市场实时行情接口实战
后端·算法·github
峰向AI2 小时前
Anthropic 工程师每天都在用的小工具:核心代码只有四行,26万次浏览
github
fthux2 小时前
被主流遮住的世界:那些不常见却值得认识的编程语言
人工智能·ai·开源·github
高频因子挖掘机6 小时前
QuantDash 成交量单位统一实战:从“手”到“股”的跨市场量化数据清洗全流程
后端·算法·github
CoderJia程序员甲6 小时前
GitHub 热榜项目 - 周榜(2026-08-22)
ai·大模型·llm·github·ai教程
丰锋ff7 小时前
Github使用教程
github
领创工作室1 天前
GitHub Workflows 全面解析:从核心概念到开源实现
运维·github