git-subtree

How to remove history of deleted git subtree folder?

别说谁变了你拦得住时间么 提交于 2019-12-04 10:51:34
I added a git repository using git-subtree. The problem is that I did a hard reset back to before the repository was added with git-subtree. Now the commit history is still in the repository but it's disconnected from master. Any idea how to remove it? I tried git rm --cached with no luck. LopSae To remove right away commits that are already unreachable, which would be the case of your subtree commits, you can use the following commands: git reflog expire --all --expire-unreachable=0 git repack -A -d git prune git gc will not immediately collect unreachable commits, since these (in the default

Pushing subtrees in a git repo

百般思念 提交于 2019-12-04 09:19:30
I'm quite new to Git: I come from SVN and there I found really powerfull the :external feature. Here in Git I haven't find something similar: submodules are perfect for adding project modules that are not always required. They must be initialized after the repo cloning and you can't include only a subdir of the original project. subtrees are really good for adding libraries (they also allow subdir inclusion), but pushing them is a real pain. So the scenario is this: I have a project, in which I want to include some libraries. I want the possibility to change all these libraries and pushing

git subtree push changes back to subtree project

冷暖自知 提交于 2019-12-04 07:59:46
问题 The short of what's below: I want to push commit messages to a subtree, but only the messages that apply to that tree. How do I do this? I have two projects, Master and Slave . Slave is checked out as a subtree of Master checked out to lib/slave via git subtree merge --prefix=lib/slave --squash projects/slave where projects/slave is a branch that Slave is checked out into: Branches: master projects/slave → slave Now I'm working on my master branch, making commits to files that are part of

git splitting repository by subfolder and retain all old branches

淺唱寂寞╮ 提交于 2019-12-04 07:32:06
问题 I have a git repo with 2 directories and multiple branches, I want to split them and create all branches `-- Big-repo |-- dir1 `-- dir2 Branches : branch1, branch2, branch3 ... What I want I want to split dir1 and dir2 as two separate repos and retain branches branch1, branch2 ... in both repositories. dir1 Branches : branch1, branch2, branch3 ... dir2 Branches : branch1, branch2, branch3 ... What I tried: I am able to split them into 2 repos using git subtree split -P dir1 -b dir1-only git

Deploy git subdirectory on heroku

五迷三道 提交于 2019-12-04 06:47:53
I have to deploy a git subdirectory from a non master branch. I have looked at this answer and to the docs on Heroku , but when I issue git subtree push --prefix visualizations heroku develop:master I get the following error error: src refspec d02911f4e410256fae0760f87f186289436ff98b:refs/heads/develop does not match any And I really don't know how to proceed. The git subtree push command does not use the localBranch:remoteBranch syntax used in the plain git push to define what local branch gets pushed into what remote branch. What you might need is just to change that last parameter: git

checkout a specific tag with git subtree

霸气de小男生 提交于 2019-12-04 03:31:25
问题 Can I use tags in subtrees? Following a specific issue: I have a git repository which includes an external repository as a subtree. I could add this external repository and checkout a specific branch from this repo. With git subtree pull --prefix=<dir> --squash <remote> <branch> the update from the selected branch works well. Now is it possible to checkout a specific tag? I couldn't find some information about tags in subtrees... 回答1: Actually any reference should work. The man page for

Splitting many subdirectories into a new, separate Git repository

北战南征 提交于 2019-12-04 03:28:24
问题 This question is related to: detach-many-subdirectories-into-a-new-separate-git-repository Git subtree and multiple directories Instead of detaching a single subdirectory, I want to detach a couple. For example, here is my folder structure: /app1 /file1 /file2 /folder1 /folder2 /app2 /file3 /file4 /folder3 /folder4 /test /file5 /file6 /folder5 /folder6 /README.md /new_file And I would like this instead: /app1 /file1 /file2 /folder1 /folder2 /app2 /file3 /file4 /folder3 /folder4 I have tried

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

一世执手 提交于 2019-12-03 23:11:23
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 of the subtree being merged: <<<<<<< HEAD Another inserted line ======= >>>>>>>

git: How to split off library from project? filter-branch, subtree?

旧巷老猫 提交于 2019-12-03 18:37:53
问题 So, I've a bigger (closed source) project, and in the context of this project created a library which could also be useful elsewhere, I think. I now want to split off the library in its own project, which could go as open source on github or similar. Of course, the library (and its history there) should contain no traces of our project. git-subtree seems like a solution here, but it does not completely fit. My directory layout is something like this (since it is a Java project): fencing-game

Git subtree: Use only subrepository instead of whole repository

半城伤御伤魂 提交于 2019-12-03 16:52:06
问题 I have a project that uses some 3rd Party libraries. So the directory structure is something like: MY_COOL_PROJECT 3rdParty LIB_1 LIB_2 Source MY_PROJECT The libraries are located in separate repositories. So, if I want to use a git repository for the 3rd Party libraries I can do: git subtree add --prefix 3rdParty/LIB_1 --squash http://My3rdPartyLibs.com/lib1.git master However, inside lib1.git repository there is only one bin folder I need. It contains also folders such as documentation,