N
N
nixischev2014-07-06 12:18:46
git
nixischev, 2014-07-06 12:18:46

Git - how to use a modified file in all branches?

Good day!
The task is the following - there is a configuration file, it has been changed for local use, you need to make sure that it is not uploaded along with the rest of the files when you commit / push (git stash, if I understand correctly) and at the same time it must be available (modified) from all branches of the current repository (meaning when switching branches), i.e. when doing git checkout this file should not change. Please tell me how this can be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
evnuh, 2014-07-06
@evnuh

Actually, there is gitignore for this task .
At the root of the repository, create a .gitignore file, simply write down the path to the file that you want to ignore (relative to the repository root).
Next, you need to exclude it from the cache, because. git will not remove it from tracking if it was already there. Team:
git rm --cached имяфайла

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question