初始化一个Git仓库,使用git init命令。

提示:使用 'master' 作为初始分支的名称。这个默认分支名称可能会更改。要在新仓库中
提示:配置使用初始分支名,并消除这条警告,请执行:
提示:
提示:	git config --global init.defaultBranch <名称>
提示:
提示:除了 'master' 之外,通常选定的名字有 'main'、'trunk' 和 'development'。
提示:可以通过以下命令重命名刚创建的分支:
提示:
提示:	git branch -m <name>
作者身份未知

*** 请告诉我您是谁。

运行

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

来设置您账号的缺省身份标识。
如果仅在本仓库设置身份标识,则省略 --global 参数。

fatal: 无法自动探测邮件地址(得到 'feng@feng.(none)')

<aside> 💡 默认使用ZhuFeng,[email protected](本人)

</aside>

添加文件到Git仓库,分两步:

  1. 使用命令git add <file>,注意,可反复多次使用,添加多个文件;
  2. 使用命令git commit -m <message>,完成。
第一步,用命令git add告诉Git,把文件添加到仓库:
第二步,用命令git commit告诉Git,把文件提交到仓库:
git commit -m 'message'