我们一直在研究git子模块,我们想知道使用子模块的存储库有什么优势(如果有的话),在另一个存储库中有一个带有.gitignore文件的存储库.
没有子模块的示例:
mkdir a
cd a
git init
touch test1.txt
echo "b" > .gitignore
git add .
git commit -m "Adding test1.txt and gitignore"
mkdir b
cd b
git init
touch test2.txt
git add .
git commit -m "Adding test2.txt"
git log
cd ..
git log
Run Code Online (Sandbox Code Playgroud) 我有一个我一直在研究的项目叫做"系统",我将其设置为回购.我一直在推动这个项目(system.git).
现在我想将它发布到像github这样的网站.获取当前项目并将其推入新github项目而不丢失历史记录的最佳方法是什么?
谢谢!
我正在从一个系统迁移到另一个系统,在此过程中,我将同时运行两个系统.我需要能够在保持每个表的主键的同时从一个表单向同步到另一个表.
在这个例子中,我有两个表(A)和(B).我需要根据公共外键(下面的match1和match2)将表B中的value1和value2(下面)同步到表A. 表A将包含除表B之外的其他字段,并且B中的某些字段将不会同步.
我该怎么做:
这是一些演示数据:
DROP TABLE IF EXISTS `a`;
CREATE TABLE IF NOT EXISTS `a` (
`id1` int(10) unsigned NOT NULL,
`match1` int(10) unsigned NOT NULL,
`value1` varchar(255) NOT NULL,
PRIMARY KEY (`id1`)
);
INSERT INTO `a` (`id1`, `match1`, `value1`) VALUES
(1, 1, 'A'),
(2, 2, 'A'),
(3, 3, 'B'),
(4, 4, 'C'),
(5, 5, 'C');
DROP TABLE IF EXISTS `b`;
CREATE TABLE IF NOT EXISTS `b` (
`id2` int(10) unsigned NOT NULL,
`match2` int(10) unsigned …
Run Code Online (Sandbox Code Playgroud)