[Newbie Tutorial] Use of git - create, add, submit files to the repository

  1. In a suitable place, create a new folder, right-click in the blank space of the folder, and select "Git Bash Here"
    Choose Git Bash Here

  2. Create a file

$ mkdir learn-git //新建一个“learn-git”的目录
$ cd learn-git //
$ pwd //显示当前目录

  1. Create a new txt file in this directory: readme.txt
  2. Enter the following command in the pop-up window
$ git init //init命令把这个目录变成Git可以管理的仓库
$ git add readme.txt //add 把文件添加到仓库
$ git commit -m "wrote a readme file" //commit把文件提交到仓库 
									  //-m后面是本次提交的说明

Guess you like

Origin blog.csdn.net/qq_41612593/article/details/115233316