Git版本控制——场景一:提交文件

110 阅读1分钟

提交文件

步骤1 - git init

$ git init
Initialized empty Git repository in /home/scrapbook/tutorial/.git/
$ ls -A
.git
$

执行git init后,在当前目录下,.git子目录会被创建。该子目录包含Git用于存储其信息的元数据。

步骤2 - git status

$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        hello-world.js

nothing added to commit but untracked files present (use "git add" to track