Hike News

做task.xueer之前的命令行操作

  • 肯定是先要有node (-v 看看版本)。
  • 之后淘宝镜像

    sudo npm install -g http-server –registry=https://registry.npm.taobao.org

  • 建立xueer文件夹

    work mkdir xueer

  • 建立html,css文档

    xueer touch index.html
    xueer touch index.css

  • github新建仓库。

  • 使其有git功能,和github建立关系,并忽视没有太大意义的文档(.DS_Store),只保留html,css,.gitignore可见。

    xueer git init
    Initialized empty Git repository in /Users/qianziqianshang/work/xueer/.git/
    xueer git:(master) ✗ vim .gitignore

  • 按照github操作来。

    ➜ xueer git:(master) ✗ git add .
    ➜ xueer git:(master) ✗ git commit -m “initial commit”

    [master (root-commit) 8d22ed1] initial commit
    3 files changed, 1 insertion(+)
    create mode 100644 .gitignore
    create mode 100644 index.css
    create mode 100644 index.html
    

    ➜ xueer git:(master) git remote add origin https://github.com/wwyqianqian/task-xueer.git
    ➜ xueer git:(master) ✗ git push origin master

    Counting objects: 4, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (4/4), 275 bytes | 0 bytes/s, done.
    Total 4 (delta 0), reused 0 (delta 0)
    To https://github.com/wwyqianqian/task-xueer.git
    [new branch]      master -> master
    
  • 正常写html,css,在本地查看

    ➜ xueer git:(master) ✗ http-server