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
相关推荐
阿里嘎多学长4 小时前
2026-08-04 GitHub 热点项目精选
开发语言·程序员·github·代码托管
MicrosoftReactor6 小时前
技术速递|GitHub Copilot App 入门指南:快速上手
ai·github·copilot·copilot app
大眼、不聚光8 小时前
9.linux系统管理-ssh免密配置
linux·ssh·github
NutShell Wang8 小时前
拆解 GitHub gh-stack:堆叠 PR 工作流的设计取舍与工程实现
前端·git·开源·github·代码复审·开发者工具·vibe coding
午安~婉21 小时前
GitHub Token/ GitHub Stats统计显示图异常
前端·github·vercel·github token
dong_junshuai1 天前
每天一个开源项目#59 AirLLM:27.6K星,3.72GB显存跑2.8T模型
人工智能·程序员·github
lpfasd1231 天前
2026年第31周GitHub趋势周报
github
Jul1en_1 天前
【Claude Code Compact】源码级别的学习上下文压缩
java·前端·学习·github·ai编程
逛逛GitHub1 天前
Karpathy 刚发了一个帖子,怎么判断一个新模型到底行不行?
github
m4Rk_1 天前
【论文阅读】Agent 记忆机制(28):MEM1——将记忆压缩融入推理,实现近似恒定上下文的长程智能体
论文阅读·人工智能·学习·开源·github