1、在项目拉起依赖包时提交git时, 通过在项目根目录中创建文件.gitignoe 并在文件中添加忽略的文件名如: node_modules
node_modules/
# 下面自己配置使用的 忽略文件
.DS_Store
# End of https://www.gitignore.io/api/visualstudiocode
node_modules/
package-lock.json
dist/
2、git 指令常用汇总:
// 配置本地账户信息
$> git config --global user.name '[name]'
$> git config --gloabl user.email '[email]'
// 初始化项目
$> git init // 本地初始化一个git 项目
$> git clone [url] // 克隆一个远程仓库,比如GitHub
$> git remote add origin [url] // 关联到一个远程仓库
// 更改保存
$> git add // 将所有的改动计入暂存区
$> git commit -m '[desc msg]' // 将所有更改加入版本历史,并说明
$> git pull // 存远程分支拉取更改
$> git push // 将本地更改提交到远程仓库
// 分支管理
$> git branch [name] // 创建一个分支
$> git checkout [branch-name] // 切换到另一个分支
git checkout -b 分支名 // 创建并且切换到分支里
$> git merge [branch-name] // 合并指定分支到当前分支上
$> git branch -d [branch-name] // 删除一个指定分支 -D 强制删除
$> git push --set-upstream origin Wexin-220105 // 本地分子和远程建立链接 Weixin-220105分子名