Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Attributes Merge Ours

Tags:

git

merge

github

I want not to merge a specific folder to another branch.

ex) sample_folder/* merge=ours

On single file, index.php merge=ours works fine. But no idea how to apply this to files inside of the folder.

like image 344
Sang Lee Avatar asked Feb 02 '26 03:02

Sang Lee


1 Answers

This should be enough:

sample_folder/ merge=ours 

The gitattributes man page explicitly mention

Some of these settings can also be specified for a path, so that Git applies those settings only for a subdirectory or subset of files

Since the Merge Strategies only mention files, you might have to tweak the file selector

sample_folder/*/* merge=ours 
# or
sample_folder/**/** merge=ours 
like image 176
VonC Avatar answered Feb 04 '26 19:02

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!