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
相关推荐
七牛开发者33 分钟前
RAG 工程里的上下文剪枝:如何减少 68% 的上下文
前端·css·github
Alex6630285 小时前
我重写了 Hermes Agent,专门修掉了它的 4 个硬伤
github
考虑考虑6 小时前
git中的tag
git·gitlab·github
小墨同学boy7 小时前
WorkBuddy零基础教程进阶篇
人工智能·github·aigc
BerrySen1788 小时前
GitHub开源项目破圈方法论:从技术自嗨到生态共赢
开源·github
JavaGuide1 天前
一个神级 PR Review Agent 诞生了:读 diff、写总结、找风险全自动!
github·ai编程
逛逛GitHub1 天前
1.3 万人点赞的 GitHub 项目,让 AI Agent 操作 Office 文件。
github
OpenTiny社区1 天前
Skill 设计:封装、评测、运营,一次讲透
前端·github
本地化文档1 天前
xlwings-docs-l10n
python·github·excel·gitcode·sphinx