Git strategy to have a set of commits limited to a specific branch

I need to often combine between dev and master.

I also have a commit, which I only need to apply to dev, because things work locally.

Previously, I merged only from dev to master, so I had a production_changes branch that contained the "excellent commit" of the dev special commit. and from the master I combined it. Used to work perfectly.

Now every time I merge from dev to master, and vice versa, I have to choose and apply the same commit again and again :( UGLY.

What strategy can be adapted so that I can easily merge between two branches, but keep some changes on only one of these branches?

+5
source share
3 answers

I would recommend a merge file (scripts declared in the merge directive in a file ) to prevent certain files from being affected by this commit. (for example, if some files should not be changed, this driver will be as simple as “save my” merge . This was used to merge only certain directories or to keep track of how configuration files are managed on each branch.) .gitattributes

OP adds:

But I'm looking for a more smart solution if it exists, for example, "create a branch that has excellent commit and apply it to the master, fake it on dev"

?

, git rerere ( : , dev , - , , .

Rerere Your Boat... .

+1

git: diff , dev. "" : - git merge -s ours devfix-branch ( master)

dev : git merge devfix-branch. dev master , , .

, .

+1

(.. ) dev-, dev, . , , , .

0

All Articles