git-subtree

git subtree push --squash does not squash

半城伤御伤魂 提交于 2019-12-10 03:49:03
问题 I am using git subtree to organize my git repositories. Let's say I have a main repository called repo and a library called lib . I successfully "imported" the lib repository by squashing its history. I would now like to contribute back to lib by squashing the history too. This does not seem to work: I specify the --squash option to git subtree push but when looking at the history I still send all the commits. How to reproduce Here is a script showing the minimal commands needed to reproduce

How to remove history of deleted git subtree folder?

家住魔仙堡 提交于 2019-12-09 18:48:49
问题 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. 回答1: 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

After using git filter-branch --subdirectory-filter how do I still use old repo and reclaim git space?

左心房为你撑大大i 提交于 2019-12-08 07:27:12
问题 I use git filter-branch to split a subfolder out into a new repository, refer to https://help.github.com/articles/splitting-a-subfolder-out-into-a-new-repository/ and https://stackoverflow.com/a/45983384/301513 My question is, according to the steps in the article, I need to create a new repo and git pull the-subdirectory-filter-result into the new repo. But is it possible I can still use old repo and reclaim the git space, i.e to make the old .git only has that subdirectory related metadata?

git merge from subtree folder in master to branch root

孤街浪徒 提交于 2019-12-08 03:43:37
问题 Actually my question is: Is there a way to merge from folder in master to root in branch ? What i want is: read-tree from branch to folder in master branch make some changes (add files in subtree folder) under master branch merge theese changes (added files) from subtree folder in master to branch root I've tried this tutorial: https://git-scm.com/book/en/v1/Git-Tools-Subtree-Merging But results are unexpected: I did: $ git init $ touch fileInMaster $ git add -A $ git commit --all -m 'initial

History of subtree merged files

送分小仙女□ 提交于 2019-12-08 02:06:44
问题 I wanted to merge a folder from one repository to another according to the subtree merge method (according to How do you merge two Git repositories? and http://nuclearsquid.com/writings/subtree-merging-and-you/) Now I'm confused since the files I added seem to have forgotten their history: git log -p oneMergedFile gives me a diff looking as if the file was newly added, while git log gives me the full history, i.e. containing the history of the merged branch. How can I get the entire history

Git subtree export and re-import woes

时光毁灭记忆、已成空白 提交于 2019-12-07 11:26:15
问题 I have a larger git repository (A) that shares a certain amount of code with another project (B) of mine. To make maintenance easier, I decided to have a third repository with the common code (C) which will then be used via git subtree . I prepared everything in A (putting the common code in folder "sub") and used the procedure described in Detach (move) subdirectory into separate Git repository to create C Now that I have C with just a few commits, I wanted to put it back into A, folder sub.

How to deal with partial svn:externals when migrating to Git?

时光总嘲笑我的痴心妄想 提交于 2019-12-07 08:30:48
问题 I would like to import a SVN repository into a GitHub Enterprise repository There are many questions related to this matter and most of them can be addressed either with Git submodules or Git subtree. In my case I have two repositories: The main project repository The modules repository (a big SVN repository over 2 GB) This module repository has the following architecture: foolib/ moduleA/ ... moduleB/ ... ... For the project, only few modules from foolib are used as svn:externals . For

How do I append one git history to another?

醉酒当歌 提交于 2019-12-07 03:27:20
问题 I have a repository that contains the code for an old version of a website that is no longer being used on master . The site was completely redesigned in a new repository, and the code and history from that repository was copied over into a branch in the repo of the old site, let's call it new_site . I can't merge new_site into master , since the histories are entirely different. I've investigated both submodules and subtree merges a bit, but both seem to only be relevant when you're trying

git merge from subtree folder in master to branch root

元气小坏坏 提交于 2019-12-06 15:04:40
Actually my question is: Is there a way to merge from folder in master to root in branch ? What i want is: read-tree from branch to folder in master branch make some changes (add files in subtree folder) under master branch merge theese changes (added files) from subtree folder in master to branch root I've tried this tutorial: https://git-scm.com/book/en/v1/Git-Tools-Subtree-Merging But results are unexpected: I did: $ git init $ touch fileInMaster $ git add -A $ git commit --all -m 'initial commit' $ git checkout master $ git remote add rack_remote https://github.com/schacon/rack.git $ git

What came first: git subtree merge strategy or git submodule?

孤街醉人 提交于 2019-12-06 12:45:50
问题 What is more recent invention — git subtree merge strategy (not the new git-subtree command) or git submodule command (or maybe underlying mechanism if there was a separate one symmetrical to git subtree command vs. merge strategy). What was included in Git distribution release first? Bonus points for links to relevant Git ML posts. I tried do dig that info from Git commit history, but got lost somewhere in 2007-2008 for both features. 回答1: Subtree merge seems to be a tad older: Introduced by