仓库
一句话解释
仓库 (仓库) 是 folder Git tracks — 它存储你的项目's files and 完整 history 的更改.
用大白话说
Git 仓库是 项目 folder 那个 Git 是 watching. 内部它, Git maintains 隐藏 .git directory that records every change you commit, along with metadata like who made the change and when. This lets you travel back to any point in the project's history.
You create a repository with git init in an existing folder, or by cloning an existing repo with git 克隆. A single repository can hold anything from a tiny script to a huge application, and it tracks text files (source code) best — binary files like images are tracked but cannot be diffed line by line.
Repositories live in two places: on your local machine (where you edit and commit) and on a remote server like GitHub (where you push and pull to collaborate). The local repo is the source of truth for your working copy; the remote is the source of truth for sharing.
示例
# Create a new repository in the current folder
git init
# Check the repository status
git status
# Clone an existing repository from GitHub
git clone https://github.com/user/project.gitgit init 创建新 局部仓库. git 克隆 复制 remote 仓库到 你的 machine, 包含它的完整 history.
相关术语
相关资源
相关项目
- 创建仓库 Workflow
练习创建 and 配置仓库
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。