What does git pull –rebase –ff-only do?

I saw a command line reference which recommended git pull --rebase --ff-only. I thought git would reject that, but it doesn’t.

What does the combination of --rebase with --ff-only mean?

Edit: I perfectly know what each alone does.

  • extract multiple directories using git-filter-branch
  • Git conflict when pulling from repo forked from me, even though last thing I did was pull from it
  • git rebase on other branch
  • How do I edit after squashing while doing an interactive rebase?
  • How to squash all git commits into one?
  • Rebase entire development branch onto new master branch
  • git rebase onto remote updates
  • Remove a commit from remote git history which I don't have locally
  • 2 Solutions collect form web for “What does git pull –rebase –ff-only do?”

    [Edit, 4 Dec 2016: as of Git version 2.6, git pull is no longer a script, so it is no longer easy to see what it does and the technical details below no longer apply. But --ff-only is still only useful when merging, not when rebasing.]

    The git pull script (you can view it yourself, e.g., less $(git --exec-path)/pull) currently separates out --ff-only into a variable named $ff_only that it subsequently ignores entirely if it winds up doing a rebase:

    case "$rebase" in
    true)
            eval="git-rebase $diffstat $strategy_args $merge_args $rebase_args $verbosity"
            eval="$eval $gpg_sign_args"
            eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}"
            ;;
    *)
            eval="git-merge $diffstat $no_commit $verify_signatures $edit $squash $no_ff $ff_only"
            eval="$eval $log_arg $strategy_args $merge_args $verbosity $progress"
            eval="$eval $gpg_sign_args"
            eval="$eval FETCH_HEAD"
            ;;
    esac
    eval "exec $eval"
    

    What this means in the end is that your --ff-only option gets ignored.

    It’s possible that in the future, git might reject these as incompatible, so it’s probably wiser to leave out an explicit --ff-only when using an explicit --rebase.

    Seems --ff-only will be ignored when using --rebase.

    Git Baby is a git and github fan, let's start git clone.