How can I fast-forward a single git commit, programmatically?
- by Norman Ramsey
I periodically get message from git that look like this:
Your branch is behind the tracked remote branch 'local-master/master'
by 3 commits, and can be fast-forwarded.
I would like to be able to write commands in a shell script that can do the following:
How can I tell if my current branch can be fast-forwarded from the remote branch it is tracking?
How can I tell how many commits "behind" my branch is?
How can I fast-forward by just one commit, so that for example, my local branch would go from "behind by 3 commits" to "behind by 2 commits"?
(For those who are interested, I am trying to put together a quality git/darcs mirror.)