Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git subtree tags

Tags:

git

tags

subtree

I want to use subtree merges to pull a remote project into a directory in my own git tree. I followed the instructions here: using subtree merge

But I'm not sure how to checkout a tag. I imagine this is a common request - you want to pull in an external project but get a safe tagged version of the source. The subtree merge solution works great, but I'm not sure how to get the tag I want? Love git, but sometimes it hurts my head....

like image 982
cmaughan Avatar asked Jan 23 '10 17:01

cmaughan


2 Answers

When you type git tag you'll get list of all tags in your repository. Remote tags also show here, and I don't know if they may conflict (didn't check that), and how to check what tags were imported to your repository.

But what I checked is that when you add remote and it fetches from other project, you see what tags are imported. Then you can merge with that tag, for example:

git merge -s ours --no-commit v0.1.2 # instead of: Bproject/master (2)
git read-tree --prefix=dir-B/ -u v0.1.2 # instead of: Bproject/master (3)

and it should work.

Hope it helps a little, but I'm not as advanced with git as I would like :-)

like image 155
MBO Avatar answered Oct 05 '22 23:10

MBO


GitHub has an adoption of the kernel.org's HowTo: http://help.github.com/subtree-merge/

like image 27
Bengt Avatar answered Oct 06 '22 00:10

Bengt