I
I
Ivan2015-02-23 09:16:15
git
Ivan, 2015-02-23 09:16:15

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

4 answer(s)
L
LIAL, 2015-02-23
@IvanG

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

A
aen, 2015-02-23
@aen

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.

V
Victor, 2015-02-23
@v_decadence

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.

I
Ivan, 2015-02-23
@IvanG

Thanks for the answers, I thought that in this issue there is some kind of "standard" way out of the situation, apparently not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question