Home  >  Article  >  Web Front-end  >  Easy-to-understand usage of Git

Easy-to-understand usage of Git

php中世界最好的语言
php中世界最好的语言Original
2018-03-24 09:14:461407browse

This time I will bring you the easy-to-understand usage of Git. What are the precautions when using Git? The following is a practical case, let's take a look.

The front-end will rely on a large number of npm third-party plug-ins when using automated tools such as webpack, gulp, vue-cli, react-native cli, and these plug-ins are installed will be installed under node_modules. Since these plug-ins are very large, we do not need to submit them to the remote warehouse when submitting the code. At this time, we only need to create a new .gitignore file and configure it in it. Good file paths that need to be ignored, so that when we submit the code, git will help us automatically ignore these plug-ins we have installed, and the corresponding dependencies of the plug-ins will be displayed in the package.json file, so that other friends can UpdateAfter the code, you only need to run npm i to install it locally, which greatly reduces the size of the transferred code.
Example:

1. Generate .gitignore file
touch .gitignore
2. Configure the file path that needs to be ignored.
/node_modules
/build

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website Other related articles!

Recommended reading:

Mysqld_multi deployment stand-alone detailed explanation

The reason why the installation of mysql service failed to start

How to query different databases with one SQL statement

The above is the detailed content of Easy-to-understand usage of Git. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn