版本库

又称仓库(repository),表示一个里面的文件可以被 git 管理的仓库

创建

想要这么一个仓库很简单,首先你需要选定一个文件夹来作为仓库。
选好后 cd 到那里,然后:

$ git init
Initialized empty Git repository in /home/username/Desktop/learngit

这样仓库就建好了,是不是很简单?

把东西放进仓库

一、用命令git add 做好把文件添加到仓库的准备(添加到暂存区):

$ git add test.txt

二、用命令git commit 把文件提交到仓库:

$ git commit -m"let's test"
[master b7d7e6c] let's test
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test.txt

其中,-m后面输入的是本次提交的说明

你可能感兴趣的:(版本库)