git
Preface
What is git?
Git is currently the world's most advanced distributed version control system (no one). Git is an open source distributed version control system that can effectively and quickly handle the version management of projects from very small to very large.
contents
- What is git
git instructions
- git basic commands
- git four major workspace commands
- git view config configuration
Before learning the git command, we can first create a folder gitcode D disk then right-click under the file to open Git Bash Here and then learn
git instructions
cd ..: step back to the current file (cd needs spaces)
cd ..
cd selected file: enter a file
cd gitcode
pwd: display the current path
pwd
ls(ll): display all files ll: you can see more
ls / ll
touch file name + suffix: create a new file
touch test.html
rm deleted files: delete files
rm test.html
mkdir folder name: create a new folder
mkdir div
help: help document
help
exit: exit
exit
git command
git four major workspaces
Working directory:->add-> temporary storage area -> commit -> resource area -> push remote warehouse
$ git init // 初始化一个git仓库
$ git status // 跟踪文件
$ git add "文件" // 将文件添加到 暂存区
$ git commit -m "" // 将文件添加到资源库(本地仓库)
git-View config configuration information
config configured with system (system) level global (user level)
And local (current warehouse). The three settings are from system> global> local
The bottom-level settings will override the top-level configuration, and you can use system-global-local to locate the configuration file separately
config configuration instructions:
git config
View system config
git config --system --list
View current user (global) configuration
git config --global --list
View current warehouse configuration information
git config --local --list
Set username
git config --global user.name "用户名" <- 自己取
如: git config --global user.name "myname"
Set user.email
git config --global user.email "xxxx@qq.com" <- 自己常用的邮箱
git config --global user.email "test@qq.com"
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。