Lazy loaded image
技术分享
🧑‍💻推送本地项目至Github并部署Vercel
Words 701Read Time 2 min
2026-3-30
2026-3-29
type
Post
status
Published
date
Mar 30, 2026
slug
summary
tags
开发
Ai
category
技术分享
icon
password

前置准备

  1. 安装 Git : https://git-scm.com/downloads
  1. 注册 GitHub 账号 : https://github.com
  1. 配置 SSH 密钥 (推荐)或记住 GitHub 用户名密码

步骤一:本地 Git 初始化

步骤二:GitHub 创建远程仓库

方式 A:通过 GitHub 网站
  1. 登录 https://github.com
  1. 点击右上角 + → New repository
  1. 填写信息:
      • Repository name : ginon-finance-nav (或你喜欢的名字)
      • Description : 专业投资导航平台
      • Public (公开)或 Private (私有)
      • 不勾选 "Add a README"(因为本地已有)
  1. 点击 Create repository

步骤三:关联远程仓库并推送

方式 A:使用 SSH(推荐)
# 先重命名本地master分支,否则会出现分支不匹配导致失败,github默认分支:main git branch -m master main
notion image
方式 B:使用 HTTPS
git push -u origin master
# 查看修改状态 git status
# 添加修改的文件 git add .
# 提交修改 git commit -m "描述你的修改"
# 推送到远程 git push
# 检查网络连接,或尝试用 HTTPS 而不是 SSH
# 需要配置 SSH 密钥 ssh-keygen -t ed25519 -C "你的邮箱" cat ~/.ssh/id_ed25519.pub  # 复制到 GitHub Settings -> SSH Keys
notion image
 

第一步:生成 SSH 密钥

打开终端,运行下面命令(一路回车,不用输入任何内容):
ssh-keygen -t ed25519 -C "你的GitHub邮箱"

第二步:打开密钥文件并复制公钥内容

cat ~/.ssh/id_ed25519.pub

第三步:把密钥粘贴到 GitHub

  1. 打开 GitHub → 右上角头像 → Settings(注意不是仓库的settings)
  1. 左侧找到 SSH and GPG keys
  1. 点击 New SSH key
  1. Title 随便填(如:我的笔记本)
  1. Key typeAuthentication key
  1. Key 框里直接粘贴(就是刚才复制的内容)
  1. Add SSH key

第四步:测试是否成功

终端运行:
ssh -T git@github.com
出现下面这句话就是成功了
Hi xxx! You've successfully authenticated...
 
上一篇
A股全天市场交易情绪报告2026/03/30
下一篇
Vibe coding & Vercel Deploy