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
相关推荐
峰向AI19 分钟前
Notion 太贵?这个 40K Star 的开源知识库,让你零成本搭建团队 wiki
github
逛逛GitHub1 小时前
37K Star 的 GitHub 开源项目开放 AI 网关,10 人团队免费用。
github
FuckPatience3 小时前
Git:the remote end hung up unexpectedly,Everything up-to-date
github
szephyr4 小时前
GitHub Actions 实战:给个人项目接上免费的自动部署流水线
ci/cd·github·devops·自动化部署·github actions
m4Rk_4 小时前
【论文阅读】Agent 记忆机制(67):MemPO——用记忆级信用分配训练 Agent 主动管理长程上下文
论文阅读·人工智能·学习·开源·github
parksben6 小时前
OpenSider:让浏览器驱动 Agent
开源·github·agent
ShineWinsu6 小时前
对于Git:远程操作的超详细保姆级解析
linux·git·gitee·github·远程仓库·分布式版本控制系统·远程操作
Gu0Qiang7 小时前
从 0 到 1 打造 AI 提示流编排器:条件分支路由、Kahn 图剪枝与 HTTP 节点实战(开源系列 06)
人工智能·github
ShawnLiaoking7 小时前
ADS305 Big data Lecture 2
github
AlfredZhao9 小时前
Git 提交代码:从报错到 SSH 免密推送
github