cheecheeo
cheecheeo

Reputation: 692

How to git clone or checkout the most recently modified branch?

I'm working with some projects that use master as the stable branch and use feature branches for feature development. I'd like to integrate against the most recent work. Is there a way to have git clone or checkout the most recently modified branch?

Upvotes: 0

Views: 88

Answers (1)

user3159253
user3159253

Reputation: 17455

Try the following git rev-list --all | head -1 | xargs git name-rev to get the most recent (in terms of time) commit branch.

Upvotes: 1

Related Questions