Search code examples
gitandroid-studiomergefast-forward

Git: Android Studio "--ff-only" merge option is greyed out


I'm working on an Android java app and just finished a feature called "addmypicture" that I need to merge with "Master".

I'd like to keep track of history so, as far as I know, the option I should use for merging is --ff-only, but for any reason it appears greyed out in Android Studio, and the only option is to do "--no-ff".

Haven't tried using the console because this is a big feature and I feel more comfortable doing it through the GUI.

My question is how to un-grey out "--ff-only" option and if, given my requirements of keeping history, is the recommended option to go.

enter image description here


Solution

  • Check first if the merge would be fast-forward anyway, meaning check if the history is

    m--m--m         (master)
           \
            f--f--f (feature/addmypicture)
    

    Use git log --graph --oneline --decorate from your current branch.

    If the merge is a fast-forward one, that could explain why --ff-only is grayed, considered the merge is in this case by default fast-forward.