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?

  • SSL verification problems trying to clone git repo with cocoapods
  • What to do if a Git submodule moves to another server?
  • git: List just the files modified for all stashes
  • has anyone produced an in-memory GIT repository?
  • Git:nothing added to commit but untracked files present
  • How to remove a git branch in Netbeans?
  • Edit: I perfectly know what each alone does.

  • Is it possible to accept user input as part of a remote git post-receive hook?
  • Bonobo Git Server - HTTP Error 500.19 - Code: 0x80070021
  • Programmatically read files and information from a Git repository
  • Git - Ignore certain files contained in specific folders
  • Unable to git clone
  • git undo all uncommitted changes
  • 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
            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"
    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.