So we have created a template project "template_proj.git".
update git version is: 2.14.1 on Windows 7 prof
We have new projects that are empty except they have one commit with a .gitignore file in them. Lets say one of these projects is called "projectA.git".
So my method is:
- clone template_proj.git into a folder called "Project_A". For this I use:
clone template_prog.git --depth=1 --recursive
- Remove the remote:
git remote rm origin
- Add the new remote:
git remote add origin projectA.git
- Forcefully merge the projects:
git pull origin master --allow-unrelated-histories
This works well. Note: The main reason that I don't just delete my .git folder from the template clone is that it has submodules.
This gives me a repo with 3 commits (which are exactly what I want):
- the tip of template_proj.git
- the tip (and only commit) of projectA.git
- the commit that contains new merge of the two.
However there is the special tag/branch "grafted" associated with the the tip of template_proj.git
commit. I don't really want that.
So my questions:
- Is this an efficient way to do this operation (i.e. is there a better way)?
- How do I get rid of the
grafted
tag? - What is the
grafted
tag?
I have not been able to fully understand what grafted
really is/means - I did search for it and found some information but still not really sure. As a keyword in a git search it got over-ruled by more common items (or my google-fu is weak) :(
Update: Also this question here does not quite answer: What exactly is a "grafted" commit in a shallow clone? - because it does not really say why grafted is there or what to do about it (if anything). Also I don't have a: .git/info/grafts
file in my repo.