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
相关推荐
阿米亚波5 小时前
【C/C++包管理器】vcpkg(by microsoft)
c语言·c++·git·vscode·microsoft·github·vcpkg
打工的小王7 小时前
github教程之多人协作
github
笨笨狗吞噬者7 小时前
IRIS: shell 中的智能实时输入提示工具
github·shell
fthux10 小时前
MCP协议开发实战:从零搭建AI Agent工具链
前端·人工智能·ai·开源·github
@CLoudbays_Martin1110 小时前
Linux 服务器如何查看是否被植入后门?
linux·服务器·网络·安全·github·ssl
一次旅行10 小时前
Ollama本地私有化大模型完整工程实战
人工智能·机器学习·github
华科大胡子10 小时前
GitHub Copilot 能换成本地模型吗?—— 本地化替代方案深度解析
人工智能·github·copilot
TunerT_TQ1 天前
Valhalla 静态工程审阅 #024|蚂蚁集团Ant Design 源码证据驱动评测【大厂开源基础设施特辑】
开源·github·蚂蚁集团·#推荐系统·#typescript·#antdesign
tokenKe1 天前
Cloudflare Computer: 给每个 AI Agent 一台专属电脑 | SSP Github Daily
人工智能·github