Skip to content

Instantly share code, notes, and snippets.

@jglick

jglick/.gitconfig

Created Oct 20, 2017
Embed
What would you like to do?
git first-child
[alias]
# http://stackoverflow.com/a/30010601/12916
first-child = "!f() { git log --reverse --ancestry-path --pretty=%H $1..${2:-HEAD} | head -1; }; f"
@jglick

This comment has been minimized.

Copy link
Owner Author

@jglick jglick commented Oct 20, 2017

Taken from this tip.

Useful as a branch point for Maven projects; e.g.,

git checkout -b 1.23.x `git first-child this-project-1.23`
mvn versions:set -DnewVersion=1.23.1-SNAPSHOT
git commit -a -m 'Prep for 1.23.1'

retains

<tag>HEAD</tag>

and anything else besides <version>s that might have changed in the [maven-release-plugin] prepare for next development iteration commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.