How to do it in a git synchronized project, some files are different
PHPz
PHPz 2017-05-02 09:48:55
0
1
855

The project is synchronized using git, and now there are several requirements

Requirement 1: Call different front-end JS files online and offline

For example, vue, the local development environment calls the development version of the file, while the online environment calls the production environment version of the file. For the reason, please refer to the official documentation:

Important note: Please use the development version when developing. It will give friendly warnings when encountering common errors.

Do not use the minimally compressed version for the development environment, otherwise you will lose error prompts and warnings!

Requirement 2: Use different databases for the formal environment and the test environment

For the same DB file, I want to link to the test database locally, and I want to link to the official version of the database in the online official environment

How to do it?

Please rule out the situation where some files are out of sync by modifying .gitignore. Because it is developed by multiple people, the files in the local environment still need to be synchronized to different development environments

There is another situation that needs to be considered:

When I modify some code locally, the online environment can be quickly deployed after synchronization, instead of having to manually adjust it after each synchronization.

PHPz
PHPz

学习是最好的投资!

reply all(1)
淡淡烟草味

I haven’t actually done it, I’m just trying to see if I can give you an idea.
Using the build tool npm to implement different instructions for development and formalization, what is uploaded to git is a configuration file. What is synchronized is this configuration file (the file contains the dependencies and preprocessing (webpack, gulp) in the project).
Development and dev are placed in the same package and run dev locally. Develop run build;

The git branch function may not be able to meet your manual adjustment needs.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template