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
愚坤16 小时前
前端真有意思,JS还能独立做项目?
前端·javascript·github
dong_junshuai16 小时前
每天一个开源项目#157 Modern Web Guidance:让Agent按需查浏览器能力
github
一条Go21 小时前
OnCall 时段路由:跨午夜、左闭右开与「Local 不是时区」
后端·架构·github
黎羽_1 天前
《开源 PR 实战》系列(三):22 个 PR 之后,批量提 PR 的打法
开源·github·代码评审·pull request·协作
fthux2 天前
总想着“忙完再休息”?让 Tick Rest 提醒你,先歇一会儿
开源·github·mac·swift·提醒·消息提醒·tick rest·tick rest for mac·消息提醒app
dong_junshuai2 天前
每天一个开源项目#156 Astryx:主题编译、异步按钮与源码接管
github
逛逛GitHub2 天前
把你的 AirPods 当鼠标用,这 3 个黑科技 GitHub 开源项目有趣。
github
徐小夕2 天前
开源Vector-Graph-RAG:向量+图谱双引擎,打破纯向量RAG的效果天花板
前端·vue.js·github
GitHub实测笔记2 天前
zoxide 本机实测:一万条记查询中 5.7ms0.10 版 import --from
github