The git command

  • Git init //=> Create tool
  • git add
  • git add .
  • Git commit -m //=> Commit to staging
  • Git log //=> View historical version records
  • Git reflog //=> View all historical versions
  • Git status //=> Check the git status
  • Git reset –hard+ version number //=

Git and making

Git-hub :www.github.com A website (an open source source management platform) where users can create repositories under their own accounts. The source code used to manage the project (the source code base git is created in the repository), plug-ins, class libraries and frameworks that we are familiar with are hosted on this platform, and we can download, watch and study the source code, etc

1. Settings User Settings

  • Profile Modifies its own basic information
  • Account Change username Change the username Change the website address of the personal page
  • Security Allows you to change the password
  • Email Modification

Create a warehouse

New respository name: English plus number

  • Public Public repositories as open source projects
  • Private private warehouses are managed as collaborative projects by internal teams

2. Code View historical version information

Commit the local warehouse information to the remote warehouse

// Create a link between the local warehouse and remote warehouseGit remote add origin [Git repository address] Delete the associated information $git remote rm origin

It is best to pull before submitting

  • $git pull origin master commits local code to remote repository
  • $ git push origin master
  • $git clone [git name]
Real project development process: -1. The team leader or person in charge shall first establish the central warehouse. -2. Team members clone based on Git$git cloneCreate a remote repository and pull the default contents of the remote repository to the local "git init". Create a remote repository and pull the default contents of the remote repository to the local "git init". After each team member finishes writing their own program, store their modified content in the history area based on "git add/git commmit", and then synchronize the local information with the remote warehouse information through "Git pull/push" (possibly involving conflict handling) -4. Add collaboratorsCopy the code

Basic operations of NPM

NPM Node package manger :Node module management tool, according to the NPM we can quickly install, uninstall the required resource files (such as: jquery, VU, vue-router)

Go to nodejs.org/zh-cn/ to download nod…

  • $ node -v
  • $NPM -v The installation is successful if the version number is displayed

Module management based on NPM

www.npmjs.com/ based on NPM from NPMJ…

  • $NPM install XXX to install the module in the current project (node_modules)
  • $NPM install XXX -g to install the module in the global environment
  • $NPM I [email protected] Installs the module with the specified version number
  • $NPM view XXX version > xxx.version.json View the version information of a module (output to the specified JSON file)
When is a template installed globally? $NPM root -g = $NPM root -g = $NPM root -g = $NPM root So we can use the XXX command to operate the module installed in the local project -> can be imported into the project to use -> but cannot operate based on the command by default (because there is no. CMD file) -> However, based on scripts in package.json, you can configure some commands that NPM can execute through $NPM run XXXCopy the code
  • $NPM init -y initializes the configuration dependency list for the current project.

=> After the system is successfully created, Json in the current project. DevDependencies: develop dependencies. Scripts: configure local executable commands

  • $NPM I XXX –save saves the module in the manifest growth dependency

  • $NPM I XXX –save-dev saves the module in a manifest development dependency

  • $NPM install run the environment, according to the list to install the required module

  • $NPM root -g View the directory of the global module

  • $ npm uninstall xxx

  • $NPM uninstall XXX -g Uninstalls the installed modules

Windows: Run the DOS command in a folder

1, Window +r -> Run window, enter CMD

  • Drive letter: Goes to the specified disk

  • CD xx Goes to the specified directory

  • Drag the CD directly into the desired directory folder

Enter CMD in the folder address bar. 3. In the folder, shift+ right mouse button -> open the command window

If you want to view the contents of files in the current directory,

  • mac: ls /ls -A
  • window : dir

Lessc 1.less 1.min. CSS -x command to compile less into a CSS file

The beginning of a new project

  • Create a folder for your project
  • $git Clone = $git clone = $git clone
  • Json: $NPM init -y
  • $NPM install XXX
  • 5. Normal development
  • 6, the development may need to configure commands in the local to complete some functions (such as less) cost compilation, at this time need to cooperate with NPM executable commands
 "scripts": {"less":" less css/index.less css/index.css -x"
 }
Copy the code
  • 7. During development, we need to manage files based on Git: when generating corresponding historical versions and submitting them to temporary storage, historical area and remote repository, many files in the project need not be processed and submitted, such as node_modules
node_modules

Copy the code
  • 8. Since we didn’t commit node_modules every time we raised the price, we needed to “run the environment” every time we pulled down the application :$NPM install, which installs all the missing modules according to the dependencies in package.json in the project

Implement third-party management based on YARN

  • $NPM I yarn -g =>(YARN cannot install global modules)
  • $YARN init -y Initial configuration
  • $YARN install Run environment
  • $ yarn add xxx
  • $ yarn add xxx -g
  • $yarn remove XXX Remove the yarn

Use a synchronous mirror to speed things up

Source cutting based on NRM

  • $ npm install nrm -g
  • $NRM ls View the source
  • $NRM use taobao Switches the source