How to clone the latest stable branch to a dir via github? How to clone the latest stable branch to a dir via github? wordpress wordpress

How to clone the latest stable branch to a dir via github?


Clone from git and change to the WordPress directory

git clone git://github.com/WordPress/WordPress.git cd WordPress

Then list out the branches..

git branch -r 

This gives something like...

origin/1.5-branch   origin/2.0-branch   ...origin/3.4-branch  origin/HEAD -> origin/master   origin/master

Check out the branch you want...

git checkout 3.4-branchBranch 3.4-branch set up to track remote branch 3.4-branch from origin.Switched to a new branch '3.4-branch'


Here's what I actually ended up doing, which is included in a Fabric fabfile I have on Github:

git clone git://github.com/WordPress/WordPress.git .git checkout $(git describe --tags $(git rev-list --tags --max-count=1))

It clones the repo like normal, then does some shell magic to find the latest tagged version of WordPress (Which is where the stable branches live.)