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
相关推荐
逛逛GitHub2 小时前
1 分钟把 OpenClaw 安装到你电脑,现在真的没有门槛了
github
_Eleven2 小时前
Tiptap 完全使用指南
前端·vue.js·github
badhope9 小时前
AI Skill 技术全景解析——从“聊天机器人”到“全能战神”的进化之路
架构·github
徐小夕1 天前
我们用1万行Vue3代码,做了款开源AI PPT项目
github
苏同学1 天前
LangGraph 实战:从零实现多工具协作的可追溯文档问答 Agent
github
逛逛GitHub1 天前
给 OpenClaw 小龙虾🦞搞个像素办公室,这个 GitHub 项目有趣啊。
github
doup智能AI1 天前
数据分析师:报表自动生成与洞察——AI 员工系列 Vol.4
github
答案answer1 天前
Three.js3D编辑器必备的相机视图插件
开源·github·three.js
RickeyBoy2 天前
Git Worktree / Worktrunk:并行 AI 开发工作流实战
github·vibecoding
逛逛GitHub2 天前
55 个 AI Agent 组成虚拟公司开源,2 天就 1 万星
github