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
相关推荐
维基框架15 小时前
GitHub重构漏洞赏金计划 向AI批量报告说不
人工智能·重构·github
咖啡星人k15 小时前
【无标题】
前端·ai·github
逛逛GitHub15 小时前
本周 TOP 17 排名的 GitHub 开源项目大盘点,第一个值得收藏。
github
DogDaoDao17 小时前
OpenBrowser 深度解析:让 AI 真正「用上」浏览器的自主代理框架
人工智能·程序员·大模型·github·web·ai工具·openbrowser
晚来的棠棠20 小时前
彻底解决 github 无法访问或者访问慢的问题_github打开太慢了
github
tokenKe20 小时前
ego-lite:给 AI Agent 用的最快浏览器 | SSP Github Daily
人工智能·github
软件工程师文艺21 小时前
NewsNow 技术原理与架构
github
Vandara21 小时前
避坑指南:MOABB 从零搭建到跑通 Benchmark(Python 3.11 + MOABB v1.1.0+)
github
他们都叫我GPT侠21 小时前
【无标题】
git·github
CoderJia程序员甲21 小时前
GitHub 热榜项目 - 周榜(2026-07-26)
ai·大模型·llm·github·ai教程