0

Is it possible to skip a file during the merge between GIT branches? I tried following gitignore, gitattributes but did not help

helloworld9
  • 173
  • 2
  • 2
  • 8
  • How's gitattributes not working? Seems it is the way to go, based on https://stackoverflow.com/a/15233458/395202 . I would consider it is a duplicate unless you show us how the approach does not work for you – Adrian Shum Jun 26 '18 at 02:37
  • 4
    Possible duplicate of [Git - Ignore files during merge](https://stackoverflow.com/questions/15232000/git-ignore-files-during-merge) – Adrian Shum Jun 26 '18 at 02:39

1 Answers1

0

If by "skipping" a file in the merge you mean "letting this file as it was before merging", you can let the file conflict when the merge occurs, then tell git you want the pre-merge version of the file, with (according to your context, but probably) git checkout --ours your.file then don't forget to git add your.file and finish merging as you would normally.

Romain Valeri
  • 19,645
  • 3
  • 36
  • 61