Skip to content

原点

一句话解释

原点是 conventional name for 默认 remote 仓库 — 它是 remote 那个 git 克隆设置上 automatically.

用大白话说

origin 是不 Git keyword — 它是 只是 conventional name for 默认 remote. 当你 运行 git clone <url>, Git 创建 remote named origin pointing 到源 URL. 这个 lets 你运行 git push and git pull without specifying the remote name.

You can have multiple remotes with different names. A common setup: 原点 points to your fork, and upstream points to the original repository you forked from. You push to origin and pull from upstream to stay in sync.

The name "原点" is just a convention — you could name your remote anything with git remote 添加 <name> <URL>. But origin is so standard that most Git commands and tutorials assume it.

示例

bash
# clone sets up origin automatically
git clone https://github.com/user/repo.git
git remote -v
# origin  https://github.com/user/repo.git (fetch)
# origin  https://github.com/user/repo.git (push)

# Push to origin
git push origin main

原点是 默认 remote name 创建通过 git 克隆.

相关术语

相关资源

相关课程

解读错误信息

用大白话解释常见错误——什么意思、为什么发生、如何修复。

查看错误

← 返回术语表