Skip to content

克隆

一句话解释

Cloning downloads remote 仓库 到 你的 局部 machine, 包含 它的 完整 history and remote 链接.

用大白话说

git clone copies an entire repository from a remote server to your local machine. It downloads every file, every commit, and every branch, and it sets up the remote connection so you can push and pull afterwards. Cloning is how you get a local working copy of a project.

When you clone, Git creates a new folder named after the repository, initializes a local repo inside it, fetches all the history, and checks out the default branch. The original remote is saved under the name 原点, so git 推送 and git 拉取 work immediately.

Cloning is the starting point for contributing to an existing project. You clone the repo, create a branch, make commits, and push them back to the remote (or open a pull request if you do not have write access).

示例

bash
# Clone a repository from GitHub
git clone https://github.com/user/project.git

# Clone into a specific folder name
git clone https://github.com/user/project.git my-project

# After cloning, you can immediately work
cd project
git status

git 克隆 downloads 完整 仓库 到 新 folder. remote 是 保存 as 原点 for 推送/拉取.

相关术语

相关资源

相关课程

解读错误信息

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

查看错误

← 返回术语表