美文网首页
环境搭建

环境搭建

作者: 一杯清凉的水 | 来源:发表于2021-06-19 11:42 被阅读0次
    1. 下载 node.js,无脑安装
    2. 下载 Git,无脑安装
    3. 生成 sshkey:
      打开 Git Bash,输入:
      ssh-keygen -t rsa -C "xxx@xxx.com"(生成ssh密钥)
      cat ~/.ssh/id_rsa.pub(查看ssh密钥)
      进入码云网站,设置 - ssh公钥,把 sshkey 添加到这里
    4. 新建一个仓库,
      把码云的仓库,克隆到本地:
      进入项目,点克隆 - SSH,复制链接,
      打开 Git Bash,进入一个项目目录,输入:
      git clone ssh链接
    5. 创建项目
      cmd 输入:
      npm install --global vue-cli(安装 vue脚手架)
      进入项目目录:
      vue init webpack Travel
      image.png

    cd Travel
    npm run dev
    然后访问 http://localhost:8080/

    1. 提交到码云仓库:
      cmd 输入:
      git add .
      git commit -m "project initialized"
      git push

    2. 在其他电脑提交项目时,需要输入:
      git init (在当前目录新建一个Git代码库)
      才可以进行提交

    3. 报错:cannot find modle webpack
      cmd 在项目目录输入:
      npm install webpack-dev-server

    4. 分支开发
      --
      在码云上新建一个分支: index-swiper,
      然后 进入项目目录 ,cmd :
      $ git pull (将远程主机的最新内容拉下来后合并到本机分支中)
      $ git checkout index-swiper (切换到一个分支)
      以后就是在index-swiper 分支下进行开发了
      --
      提交:
      $ git add .
      $ git commit -m "swiper"
      $ git push (提交的当前分支)
      $ git checkout master (切换到master分支)
      $ git merge origin/index-swiper (和master分支合并)
      $ git push (提交master分支)

    相关文章

      网友评论

          本文标题:环境搭建

          本文链接:https://www.haomeiwen.com/subject/emssvctx.html