Git 的基本操作
git add . zm-logo.jpg
git commit -m ‘first commit’
git push -u origin master
拉去远程仓库的数据,语法为 git fetch [remote-name]
git fetch
fetch 会拉去最新的远程仓库数据,但不会自动到当前目录下,要自动合并
git pull
1.从服务器上将代码给拉下来:
git clone git://github.com/schacon/grit.git
2.从本地将代码给上传:
git status
git add .
git commit -m ‘project initialized’
git push
3.在多人项目合作中,需要新建分支写好功能,在去合并分支,如下
好比如在线上新建好的分支叫 index-swiper 那么本地就应该这样
git pull 获取线上新建好的分支
git checkout index-swiper //本地进去新建好的分支
git status //查看是否在新建好的分支中
4.在分支里面写好代码后,提交代码并合并分支
git add .
git commit -m ‘change’
git push
git checkout master //先切换到 maser 分支上
git merge origin/index-swiper //把线上新增的index-swiper分支的内容合并到本地的master分支
git push //提交
vue-cli 安装
cnpm install --global vue-cli --registry=https://registry.npm.taobao.orgcnpm