Answer the question
In order to leave comments, you need to log in
GIT, how to work with test branches correctly (we exclude merging changed configs)?
I recently started to deal with GIT, technical issues are well covered, I'm interested in fundamental approaches.
For example, there is a project in the repository:
1. create an additional test branch
2. in it, among other things, change the project config
3. completed work in test, merged with master
4. in addition to other changes, a config change also arrives in master, and this that's just undesirable.
How to properly handle this situation in this case?
exclude a file from replication (.gitignore, exclude, etc.)?
Which method is used and considered the most correct?
Answer the question
In order to leave comments, you need to log in
I would write it down in .gitignore, because if several people work on a project, everyone can have their own config with their own settings.
Or if there are only two configs such as dev and production - make sure that the necessary one is dynamically connected depending on the environment, then you don’t have to rollback or write to .gitignore
PS: don’t forget to store database connection data and other secure information in files that go then to the repo - highly discouraged
It's best to avoid hitting with .gitignore
, but assuming you're the only one working on that branch. Or, when merging, roll back the config file first.
In addition to the suggested options, you can simply not include changes in the config in the index before the commit.
The modified config will be on the disk, and untouched in the storage.
Again, this is assuming you don't need to work on that branch from another computer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question