git-subtree

Moving a git subtree into different repository

梦想与她 提交于 2020-01-13 10:24:27
问题 I try to move a directory and all its history from repository to another repository. Extracting the complete history of the directory is easy with git subtree split . This creates a new branch, which can easily be fetched to the other repository. Now I used git subtree add to paste the directory back into the second repository. If I look at gitk or git log --decorate --graph everything looks fine. All commits are present as expected. Also all the files are present as expected. But when I try

What is the difference between git subtree merge and git-subtree

隐身守侯 提交于 2020-01-10 08:51:08
问题 I've just found git-subtree tool that some time ago became a part of main git repo https://github.com/apenwarr/git-subtree/ However I don't fully understand what functionality does this tool provide over the already existing "git read-tree" + "git merge -s subtree". Is the only purpouse of git-subtree - making the resultant commit history look better or does it have more functionality that I've overlooked? 回答1: The commands you describe reads a subtree into a repository. The git-subtree

Git Subtree only one file or directory

跟風遠走 提交于 2020-01-10 07:19:00
问题 I use Git Subtree like below: git subtree add --prefix=directory_destination_path --squash git@bitbucket.org:kicaj/projectname.git master But in path: directory_destination_path copy all repo from projectname.git How to copy to directory_destination_path only subdirectory or only some file from projectname.git ? EDIT: One more question: How to update (automatic) files changes in both repositories were still the same? It is possible? 回答1: If I understand, you seem to want to only merge in a

Git Subtree only one file or directory

橙三吉。 提交于 2020-01-10 07:17:08
问题 I use Git Subtree like below: git subtree add --prefix=directory_destination_path --squash git@bitbucket.org:kicaj/projectname.git master But in path: directory_destination_path copy all repo from projectname.git How to copy to directory_destination_path only subdirectory or only some file from projectname.git ? EDIT: One more question: How to update (automatic) files changes in both repositories were still the same? It is possible? 回答1: If I understand, you seem to want to only merge in a

git subtree fetch - unwanted remote tags

孤者浪人 提交于 2020-01-06 04:30:06
问题 I am getting started with git subtree. When fetching from a subtree remote, one thing I notice is that after a git fetch, I have all the tags from this remote. These tags could be something like v1.0.5 , and it is impossible to distinguish tags from different remotes. This behavior is technically not surprising. But it is still undesirable. One solution could be to omit the tags with git fetch -n . I wonder if this is the recommended way to do things, or if there is something smarter that

Git subtree workflow

谁都会走 提交于 2020-01-01 15:57:45
问题 In my current project I'm using an open source forum ( https://github.com/vanillaforums/Garden ). I was planning on doing something like this : git remote add vanilla_remote https://github.com/vanillaforums/Garden.git git checkout -b vanilla vanilla_remote/master git checkout master git read-tree --prefix=vanilla -u vanilla This way I can make change into the vanilla folder (like changing config) and commit it to my master branch and I can also switch into my vanilla branch to fetch updates.

Difference between git filter branch and git subtree?

邮差的信 提交于 2020-01-01 08:48:14
问题 Was searching throw SO for an answer to this. Came across this older thread which didn't seem to give any answers. Retriggering this thread hoping someone may know! Can someone tell me the difference b/w git subtree and git filter-branch? I'll use the same example in the original question for this: git subtree split --prefix=some_subdir -b some_branch git filter-branch --subdirectory-filter some_subdir some_branch 回答1: Yes, git subtree (a contrib shell) can be used to split repos, as

Difference between git filter branch and git subtree?

最后都变了- 提交于 2020-01-01 08:48:12
问题 Was searching throw SO for an answer to this. Came across this older thread which didn't seem to give any answers. Retriggering this thread hoping someone may know! Can someone tell me the difference b/w git subtree and git filter-branch? I'll use the same example in the original question for this: git subtree split --prefix=some_subdir -b some_branch git filter-branch --subdirectory-filter some_subdir some_branch 回答1: Yes, git subtree (a contrib shell) can be used to split repos, as

git reports merge conflict with no changes, empty lines (using git-subtree)

有些话、适合烂在心里 提交于 2020-01-01 07:45:34
问题 I'm testing the use of git-subtree to merge a library repo into a bigger project. It seems great in principle. Sometimes when I do a "git subtree pull" I get merge conflicts like this: <<<<<<< HEAD ======= An inserted line from the lib repo >>>>>>> 4d348903449ebb584ab224cb34c6038fbf6b352d That's for a change that was made in the library repo, merging into a file that has not been modified locally. Or another example, where I added a line in the local project repo, but in a file that is part

Follow renames when performing git subtree split

試著忘記壹切 提交于 2019-12-31 09:34:31
问题 I have a number of subdirectories that I want to pull out into a separate repo. In order to extract these with a single command I move (rename) them to a single subdirectory inside the root. I then run: git subtree split -P my_new_subdir -b newbranch If I then checkout this new branch and run git log --follow someoldfile it only shows me the log entries pertaining to the move into the temporary subdirectory. I want to carry over the full history of those files. Is there a way to preserve full