Add/Update Git Subtree

Recently I am working on WordPress development helper library, I add it as submodule in many of my plugins, but every time during clone i forgot to init and update submodule, and some time during pull code i forgot to update new submodule. So, Finally i decided to start use Git Subtree.

Following are the set of command that will required during development and working with subtree

Add git subtree in repo

git subtree add --prefix app/lib https://github.com/rtCamp/wp-helpers.git master --squash

Update git subtree in repo

git subtree pull --prefix app/lib https://github.com/rtCamp/wp-helpers.git master --squash

FYI: There are some pros and cons of subtree and submodule, You can find many article on it just google it šŸ˜‰

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s