只需要在本地Git全局环境下配置一些信息即可:
# 查看当前的配置信息 -> 第一个时 -> user.name & user.email 都是空的
git config -l
# 全局配置user.name
git config --global user.name 'xxx'
# 全局配置user.email
git config --global user.email 'xxx@xx.com'
.idea
这个目录,该目录是webstorm生成的配置目录,而这与项目是咩有太大关系的,还有也不是所有的文件都得提交,如node_modules
里边的内容太大了,而这也不需要提交,毕竟有package.json
…….gitignore
-> 没有文件名,只有后缀 -> Git提交时,我们需要忽略一些不必要提交的文件、目录,而这个文件里边写的就是要忽略的文件名和目录名 -> 说白了,该文件里边写的是黑名单常用配置:
前端Vue项目配置:
//.gitignore
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
忽略文件的配置原则是:
注意:
开发不同的项目,需要不同的
.gitignore
我一直以为工作区有一份代码,暂存区也有一份代码,历史区也有一份代码,它们都是存有同样一份代码,但工作区有了这个忽略文件以后,每个区就有所不一样了……
我查看了一下,在没有.gitignore
,发现 .git
的大小大概和工作区里边的内容大小是差不多大的……
➹:github/gitignore: A collection of useful .gitignore templates
# 查看历史版本信息 -> 何时 谁 写了什么 key
git log
# 查看所有的历史记录,包括历史区回滚后
git reflog