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
相关推荐
fthux18 分钟前
装闭 RenoPit 源码解析(05):FastAPI与Celery如何执行AI装修分析
人工智能·ai·开源·github·open source·renopit
YuePeng5 小时前
一个注解起家,25 个模块收尾:Erupt 的生态版图长这样
后端·github
我是若尘7 小时前
发布分支落后于主干,MR 全是冲突?聊聊业界怎么治这个“祖传”难题
github
笨鸟先飞,勤能补拙8 小时前
网络安全等级保护 2.0:从定级备案、建设整改到持续合规的系统指南
网络·人工智能·windows·安全·web安全·网络安全·github
echoVic8 小时前
CI 已经绿了,为什么你的 Agent 还在用旧规则?
github
echoVic8 小时前
AI 评审最怕的不是漏报,而是审完以后代码已经变了
github
u13013011 小时前
GitHub 热榜项目:日榜(2026-08-10)
github
dong_junshuai12 小时前
每天一个开源项目#62 pdf-inspector:0.47秒解析200份PDF
开源·github
七牛开发者12 小时前
Codex 实践系列 Vol.04:用 Goal 和 Plan 管住一个长任务
java·数据库·人工智能·github·copilot
鬼手点金13 小时前
FreeLLMAPI 介绍
llm·github·nvidia·apikey·freellmapi·agnes ai·日日新