iron9light
iron9light

Reputation: 1205

How two git merge and keep some diff?

I have a config file:

in branch master:

url=http://somewhere.com

in branch local:

url=http://localhost:8080

I wanna keep all things the same, except the url value in the config file.

Upvotes: 2

Views: 71

Answers (2)

Gnujeremie
Gnujeremie

Reputation: 594

Your config file should be in your .gitignore.

Upvotes: 0

Dietrich Epp
Dietrich Epp

Reputation: 213338

Simple. Change the merge before you commit it.

git checkout local
git merge --no-commit master
(edit url, change to http://localhost:8080)
git add .
git commit

It's generally a bad idea to keep configuration files in the repository if there are multiple installations of the software.

Upvotes: 1

Related Questions