xargs (or something else) without space before parameter

I would like to execute something like this (git squash):

git rebase -i HEAD~3

extracting the 3 from git log:

  • Git rebase complication
  • TortoiseGit, configure automatic merge tool on per-file-basis
  • PHP MySQL 5.5 db connection in Openshift
  • Can I check the existence of a git repo using an SSH URL?
  • Git sparse checkout for simple web deployment
  • Configure git to track only one file extension
  • git log | blabla | xargs git rebase -i HEAD~

    This does not work because xargs inserts a space after HEAD~.

    The problem is that I want to alias this command, so I cannot just use

    git rebase -i HEAD~`git log | blabla`

    because the number would be evaluated just when I define the alias.

    I don’t have to use xargs, I just need an alias (preferably not a function).

  • Move tag one commit ahead
  • github protected branches don't offer any real security
  • error syncing with cyanogenmod repo
  • Should you have one Git repository or several when you have a project with web/ios/android applications?
  • Github search using regex
  • git jenkins advanced feature
  • 2 Solutions collect form web for “xargs (or something else) without space before parameter”

    You can use the -I option of xargs:

    git log | blabla | xargs -I% git rebase -i HEAD~%

    Try this:

    git log | blabla | xargs -i bash -c 'git rebase -i HEAD~{}'
    Git Baby is a git and github fan, let's start git clone.