I don't know how, but default merge strategy is ort in my pc, but I want to change that to recursive. I referred some online sources but none of them were useful. Can someone tell me how can I change my default merge strategy?
Change merge strategy from 'ort' to 'recursive'
3k Views Asked by Nishant Jain B18CSE067 At
2
There are 2 best solutions below
1
Amit Choukroun
On
TLDR;
set environment variable GIT_TEST_MERGE_ALGORITHM=recursive
Found out in the source code of git it check first for environment variable GIT_TEST_MERGE_ALGORITHM
once setting the value to recursive it change the default merge strategy.
I don't think it's the cleanest solution because of the TEST in the environment variable (probably meant for testing) but it's better then nothing.
Related Questions in GIT
- Push mysql database script to server using git
- Git show's file path
- Git > diffs filtered, show only certain changed classes/files
- Pushing to git repository hosted by Visual studio online without entering user name and password
- How do I create my own Git branch to work on?
- Git init --bare giving error fatal: Out of memory? mmap failed: No such device
- Sub-directory into independent repository and later merge back into main repository
- How to find the Git Revision Hash in a synced SVN repo using SubGit?
- eclipse errors when try to change to master git branch
- How to have Heroku build my development branch on a staging server?
- Is "Merged in" a commit message created by bitbucket, or git?
- Git: Multiple projects under one directory
- Permission denied hg-git
- Is it possible to clone a private git repo without adding ssh keys
- Track file in master repository which is ignored in submodule
Related Questions in MERGE
- Sub-directory into independent repository and later merge back into main repository
- R: Avoid loop or row apply function
- neo4j load csv invalid "ON MATCH"
- PIG merge two lines in the log
- In SVN, what's the different between "merge from a to b" an "merge from b to a"?
- git merge "deleted by us"
- Merge sort using CUDA: efficient implementation for small input arrays
- Merge project from other branch git
- Get a single line representation for multiple close by lines clustered together in opencv
- merge or mutate a summary (dplyr)
- How to I combine data from two XML files into the same structure?
- Merging PDF files with similar names using PDFTK and a bash script
- git has problems with squashing commits once there is "Merge branch"
- How can I combine elements at the same index from separate lists?
- Merging two sorted stacks
Related Questions in GIT-MERGE
- How to determine if Git merge is in process
- How to list merge conflicts on origin that are not on local?
- Feature branch with or without fast-forward merge?
- merge master into subtree branches
- GIT HOOK to check keyword "PROMOTE" in message when GIT MERGE is executed
- hint: after resolving the conflicts, mark the corrected paths
- git auto-merge does not work as expected
- Git: Merging very large master branch with a feature branch
- Include (realign) some branch changes into other branch
- Git - coworker somehow overwrote my entire commit while resolving a conflict
- How can a revert commit also be a merge commit?
- git cant resolve rebase conflicts as mergetool doesnt pop up
- Merge git repositories with different base dir
- Why does 'git merge' add files ending with tilde?
- Git Merge Specifics Commits
Related Questions in MERGE-STRATEGY
- Are there any git merge-strategies for ignoring submodule updates on a commit or branch merge into target branch?
- git should give me operation as conflict when same file modified in different branches
- Ignoring files that are not present in the destination branch when merging a source branch into it with git
- Why is my Git ours merge strategy being ignored?
- How to merge branch in git using `their` when in conflict
- Make All Merges Manual in Git
- Assembly scala project causes deduplicate errors
- k8s - multiple ownerrefs in CRDs
- GitLab - ignore specific files in target branch
- Override merge without loosing commits in Git
- Git - Automatically Merge
- Git and forcing to accept changes from other branch
- Pull Request Flow
- Git cherrypick and rebase onto a different history to sync a directory
- How to use THEIRS git merge strategy in android studio?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can't:1 the default merge strategy for
git merge,git cherry-pick, etc., is hard-coded.2 You can easily rungit merge -s recursive, either manually or through an alias.The
-s recursiveand-s ortstrategies are supposed to produce the same result except when-s recursivewould bail out but-s ortcan succeed. If you come across cases where this isn't true, report them to the Git developers.1For some definition of "can't" anyway: if you work hard enough at it, you certainly could. For instance, just clone Git and customize it.
2For
git mergein particular, the default isoctopuswhen giving multiple heads, and otherwise is whichever ofortorrecursiveit is for your particular Git version.