M
M
maxxi1652020-12-28 23:17:09
git
maxxi165, 2020-12-28 23:17:09

Git: how to ignore a file when pushing?

The project has a script.js file, script.min.js is generated from it.
Both files should be tracked when they are committed.
But the remote branch should only receive changes to the .min file when pushing or pulling.
How to write it?

If it matters, then I use git from under phpstorm

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Decadal, 2020-12-28
@Decadal

how to ignore a file when pushing?

if you commit changes, they will be pushed. You should not commit this file if you don't want to push it.
Both files should be tracked when they are committed.

offtopic: if they should be tracked, then they should also get into the git. You are doing something strange. It would be better if you describe what problem you are solving.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question