Use git to complete a project to build and upload

Learn git and github

git and github These are the two things are not the same,

git

Open source distributed version manager, is a "software", used to manage file folder our
role:

  1. Managed code to a remote
  2. Multi-Versioning
  3. team cooperation

github

Is a remote code hosting platform (similar to Baidu cloud), foreign websites {gitee (code cloud), domestic sites}.

Features : rely on git upload code

git installation

  1. To official website to download
    2. Double-click the installation package to run
    -> all the way to the next
    -> and finally the install
    3. Detection
    -> two ways
    . Open the command line 3-1
    => Git input command --version
    => displays the version number
    3-2 . just find an empty location
    => click the right mouse button
    => appear git bash here and the GUI here Wallpaper git
    => is installed successfully

Installation package extract links:

git the unloading

Directly to the Control Panel to uninstall

The basic process of using git

Because we git to manage folders, so use a folder inside

  1. Tell the computer, this folder is I manage the git
    git after installation, you will not manage any file on the computer folder
    must tell it to you, this folder is git management, he will manage
    to prepare a management wants to be git folder, there are two methods:
    1-1 open command, switching to the directory folder (cmd) input commands:
    git init
    1-2. Direct open the folder, right-click on the inside, click on the git bash here
    after serving, the current directory will be more of a .git folder (a hidden directory)
    when there is a .git folder in the future, and the current directory git all subdirectories are managed
    into a local repository (warehouse to store code) of a git

First input npm init -y, production package.json default file.
Here Insert Picture Description
Then enter the terminal and then git init ready to upload

Here Insert Picture Description
Here Insert Picture Description
2. Prepare our source folder src, then established src good series of documents which we need to use, such as: css js pages lib images, etc.
Here Insert Picture Description
before gulpfile.js 3. Prepare a folder, use your own suggestions here used because a new more trouble, so I directly from understanding gulp source file Bowen folder inside pull over

Links: https://pan.baidu.com/s/1FD04bEl1-W9Pa-wpa9Gwww
extraction code: LLMC
Here Insert Picture Description
4. prepare a series of aid packages, a download because a relatively trouble, so the downloaded package before suggested specific steps downloads can refer to understand gulp Bowen, here I am also directly copy the code before downloading the package came on it
Here Insert Picture Description
Note: Do not drop the comma! !

 "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/preset-env": "^7.8.4",
    "del": "^5.1.0",
    "gulp": "^4.0.2",
    "gulp-autoprefixer": "^7.0.1",
    "gulp-babel": "^8.0.0",
    "gulp-cssmin": "^0.2.0",
    "gulp-htmlmin": "^5.0.1",
    "gulp-uglify": "^3.0.2",
    "gulp-webserver": "^0.9.1"
  },
  "browserslist": [
    "last 2 versions",
    "iOS > 7",
    "FireFox < 20",
    "last 2 Explorer versions"
  ]

5. Taking into account that some sass with readers more accustomed to knock code, so here adds a packing method of sass
Here Insert Picture Description
Here Insert Picture Description
then you can download these third-party packages, and enter the terminal npm i , used before the packages are downloaded
Here Insert Picture Description

Then the third party terminal downloads the package sass: npm i -D node-sass,
Here Insert Picture Description
and finally download a compressed packet sass it.
Here Insert Picture Description
6. source files in the src folder inside the folder to add their own needs
Here Insert Picture Description
7. you need to download a third-party frameworks. Here I need to be jQuery, Swiper, Bootstrap 3.3.7 @
Here Insert Picture Description
8. Place the downloaded plug-ins and third frame made from node_modules folder one by one pulled lib folder

Here Insert Picture Description
9. Prepare a .gitignore folder Note: It is .gitignore folder, only the suffix name, no name. And write node_modules in folders inside. The main role of this folder is in github when uploading files to ignore node_modules not upload folders.
Here Insert Picture Description
10. The framework and the introduction of plug
Here Insert Picture Description
11. Testing and inspection, so we'll need to introduce the documents are introduced here.
Here Insert Picture Description
Here Insert Picture Description
11. Check the status of the working directory and the temporary area, which was red, this is not part of a managed file
Here Insert Picture Description
12. git the Add. Adding to the staging area, put all of our files are added to the staging area

Here Insert Picture Description
13. The git the commit -m "comment" : it committed to the repository Here Insert Picture Description
14. Then to your github which create a new record library, and copy the address down into the run git terminal Here Insert Picture Description
Here Insert Picture Description
15. The git the Push -u Origin Master : The master branch pushed host origin, specifying the origin as the default master, the latter can be used without any git push the parameters. To this step when you need to enter the account password, if wrong the first time, and then re-upload input again.
Here Insert Picture Description
In this way, our project is finished uploading the
Here Insert Picture Description
GitHub source file: https://github.com/win10000/xiaomi.git

At home against the war, fearless epidemic, refueling Wuhan, China refueling, humans win! ! !

Published 11 original articles · won praise 3 · Views 290

Guess you like

Origin blog.csdn.net/qq_43942185/article/details/104569016