关于npm与git的使用
一、环境集成
1、下载git
2、搭建git环境
http://blog.csdn.net/exlsunshine/article/details/18939329
其中 “找到git安装路径中git-core的位置,如:D:\Program Files\Git\libexec\git-core;”改为“D:\Program Files\Git\mingw64\libexec\git-core”【版本问题】
检测已搭建好方法:
在cmd中输入git,不会出现“不是内部文件或命令的提示”
3、下载node
目的:node的集成是为了不开启Apache,可以在浏览器中直接运行前端代码
启动node方式:
http://qianduanblog.com/post/nodejs-learning-1-install-and-start.html
在node.exe中输入命令
1 node test.js
二、基本命令
1、git clone (地址) //clone别人的代码到本地
2、cd 代码所在目录
3、git status //查看文件是否被更改
4、git add. //预添加
5、git commit -m master(master或其他目录文件)
6、git pull origin master //拉服务端代码
7、git push origin master //向服务器提交代码
8、git branch 名字 //建立分支
9、git checkout 名字//切换分支 会主动监听代码目录下所有文件
10、npm install //下载安装模块化依赖
11、npm install --global gulp
注:10、11可能需要FQ 安装失败需要镜像
资料来源:http://www.qdfuns.com/notes/17659/9993b2b188ac3fa5a523f071514272cf.html