Download Git (window system)
Baidu network disk download (git64 bit):
link: https://pan.baidu.com/s/1FrZQRKIEWP5rxVGC_fa1vQ extraction code: haup
Git official website to download:
Git verify the installation was successful
Method 1: Right-click on the desktop, appears in Figure
Embodiment 2: Open a command line window (window + R)
Input:git
Create Repository
What is the repository of it?
版本库
Also known as 仓库
the English name repository
, can be simply interpreted as a directory, all files in this directory can be inside Git to manage, modify each file, delete, Git can track order history can be traced any time or in the future at some point you can "restore."
Prelude
Right-click on the desktop using the git Bash enter
Configuring User Information
$ git config --global user.name "名字"
$ git config --global user.email "邮箱"
Switching to the appropriate directory (for example: D zGit disk directory)
cd d:\zGit
Step one: Create an empty directory ( 路径、名称最好不要有中文
)
$ mkdir 目录名
$ cd 目录名//进入目录
$ pwd//用于显示当前目录
Step two: The git init
command to become this directory can manage Git repository
$ git init
The current directory more than a .git
directory, the directory is to track and manage Git repository, all right, do not manually modify the file or folder, or change the mess, put the Git repository to destroy.
If you do not see .git directory, it is because this directory is hidden by default, use ls -ah
the command you can see.
Note:
Do not use the built-in Windows Notepad to edit any text file
Put a file into the Git repository
First, prepare a file (this file is placed in the directory created earlier).
The first step: command git add
tells Git, to add files to the repository
$ git add 文件名(含后缀名)
Step 2: Use the command git commit
tells Git, the submission of documents to the repository
$ git commit -m "wrote a 文件名(不含文件名) file"
git commit
Command, -m
enter the explanation behind this is submitted
Why add files Git needs add
, commit
a total of two steps it? Because commit many files at once can be submitted
$ git add file1.txt
$ git add file2.txt file3.txt
$ git commit -m "add 3 files."
Icon