这是我们的 Git 文件夹 。
<强度%xxxx/a/b/c/c 强度>
< 强度 > folder2/yyyy/a/b/c/c 强 >
过去,我们可以使用 SVN 将 文件夹1/XXX 与 文件夹2/yyy 合并。
在吉特也能做同样的事吗?
这是我们的 Git 文件夹 。
<强度%xxxx/a/b/c/c 强度>
< 强度 > folder2/yyyy/a/b/c/c 强 >
过去,我们可以使用 SVN 将 文件夹1/XXX 与 文件夹2/yyy 合并。
在吉特也能做同样的事吗?
最简单的解决方案是将两个目录设置为子模块/子树( 它们已经有一些不同的历史/ svn 仓库, 对不对? ) 。 然后您在文件夹1 仓库中添加一个远程, 指向文件夹2 仓库, 然后将更改合并为其他远程 :
# go to folder1 repository
cd /path/to/folder1repo
# or `cd folder1` if you are familiar with inline submodule editing caveats
# add a remote pointing to folder2 repo
git remote add folder2 /path/to/repo/folder2
# fetch it
git fetch folder2
# merge folder2 into folder1
git merge folder2/master
唯一的警告是,你实际上有一个子模块,每次你合并这些文件夹时,你都必须承诺执行超级项目(因为,例如,文件夹1将改变,超级项目必须指向不同的承诺):
cd /path/to/superproject
git add folder1
git commit -m "Merged folder2 submodule into folder1"
作为子模块的替代, 您可以使用两个焊接器的子树合并, 设置会更加复杂一点, 但随后您只需拉动来更新所有这些子树 :)
Here is a nice subtree tutorial: http://nuclearsquid.com/writings/subtree-merging-and-you/
BTW. 您可以创建一个远程到完全不同的工程, 您可以使用简单的合并 : git 使用情景是无限的 :)
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...
I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...
I have a svn repo with various apps as subdirectory of a single svn repo. That worked because I could have checked out a partial, repo. As I cant do that with git obviously I need multiple repos. I ...
I understand how to merge branches together in git, and I love how easy it makes it. I have a branch that looks like this: project/ |--subproj1/ | |---(files) | |--subproj2/ |---(files) A ...
We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...
I get this on every git svn command I try. I am using git version 1.6.4.2 on OS 10.6 The initial git svn fetch works, and i can do further fetches after that, but they do not enter the log or update ...
Given I have a master branch and a other branch. In the other branch are files I don t want to commit (e.g. log files) so I ignored them in .gitignore. When I switch to the master branch, these ...
Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...