1

Is it possible to configure in such a way that it does a recursive merge always when merging into master (throughout the team) so that I can find the base commit (of the merge commit) to know the repository state before merge?

IsmailS
  • 10,338
  • 18
  • 73
  • 128

1 Answers1

1

That would be a git merge --no-ff, in order to be sure to avoid a fast-forward merge and always generate a merge commit.

As mentioned in "Can I make fast forwarding be off by default in git?", you can attach that only to the master branch

git config branch.master.mergeoptions  "--no-ff"
Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • Also, there is `branch.master.mergeoptions` in git config files (would need to be set for all users doing such merges). – torek May 23 '14 at 06:14
  • @torek yep, I was researching that as you were writing your comment ;) – VonC May 23 '14 at 06:15
  • will this apply to everyone in the team if executed on the remote repo? – IsmailS May 23 '14 at 06:24
  • Actually I was looking for some way to enforce it on everyone in the team. – IsmailS May 23 '14 at 06:25
  • @iSid no, this would apply only to merges done directly on the rmeote repo itself. Everyone in the team is working on their *clone* of that remote repo: they need to set that config individually. Configs in Git never propagate between repos. – VonC May 23 '14 at 06:25