This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
- 查看仓库
的 远程链接: git remote -v 修 改 远程链接: git remote set-url origin <NEW_REMOTE_URL>
注 释: NEW_REMOTE_URL 为新的 远程仓库地 址
origin是 默 认的远程仓库名称 ,可 以通过 git remote rename命令 修 改
每 个远程 仓库配置 下 有 两个链接: fetch和 push
- fetch: 用 于从远程仓库拉 取 代 码
- push: 用 于将本 地代 码推送 到 远程仓库
- 查看
本地 分 支 : git branch - 查看远程
分 支 : git branch -r - 查看
所有 分 支 : git branch -a - 创建
分 支 : git branch 切 换分支 : git checkout- 创建临时
分 支 : git checkout -b 提 交更改 : git commit -m- 推送
更改 : git push 拉 取 更改 : git pull- 创建并切换分
支 : git checkout -b - 删除
本地 分 支 : git branch -d 强制 删除本地 分 支 并丢弃更改 : git branch -D- 删除远程
分 支 : git push origin --delete - 删除远程
分 支 : git push origin : 合 并分支 : git merge- 丢弃
提 交(不 改 变提交历史 ): git revert - 丢弃
提 交(改 变提交历史 ): git reset [--hard] [--soft]- --hard: 丢弃
提 交并丢弃更改 - --soft: 丢弃
提 交但保留 更改
- --hard: 丢弃
- 历史
重 写 : git rebase -i HEAD~n- n
是 一 个数字 ,表示 要 重 写 的 提 交数量
- n
完成 重 写 : git rebase --continue取消 重 写 : git rebase --abort重 命名 分 支 : git branch -m- 查看远程仓库
的 默 认分支 : git symbolic-ref refs/remotes/origin/HEAD - 查看远程仓库
的 默 认分支 : git remote show origin 将 远程仓库的 HEAD
指向 全 部分 支 列 表 : git remote set-head origin --auto切 换新的 远程分 支 : git remote set-url origin
- 报错:fatal: refusing to merge unrelated histories
- 确认
是 否 需要 合 并历史 :首 先 ,确保您真的 需要 合 并这些不相 关的历史。如果这两个分支 是 在 不同 的 上下 文中 开发的 ,合 并可能会 引入混乱 ,因 为它们可能 没 有 相 关性。 使用 --allow-unrelated-histories: 如果您确定 要 合 并这些不相 关的历史,可 以在合 并命令 中 使用 --allow-unrelated-histories参 数 。例 如,如果您要将 feature分 支 合 并到 master分 支 ,可 以这样做:git merge --allow-unrelated-histories feature- 创建
新 的 共同 基 础分支 : 如果您需要 在 两个不 相 关的分 支 之 间保留 共同 的 历史,可 以考虑创建 一个新的共同基础分支,将 两个分 支 合 并到这个基 础分支 上 ,然 后 继续开发。
- 确认
- 报错: error: unable to delete 'master': remote ref does not exist
分 支 名称 错误- 远程仓库
同 步 问题 本地 分 支 与 远程分 支 不一致 - 权限问题
解 决: 远程仓库不 存在 , 删除本地 的 引用 : git remote prune origin