我创建了一个项目(https://github.com/twaldecker/vim-cheat-sheet),现在我意识到我喜欢这个样式表的样式,并希望用它创建一个模板。
我所做的是:
git clone cheatsheet-vim cheatsheet-template
cd cheatsheet-template
# remove vim specific content, some additions
cd ../cheatsheet-vim #go back to vim project
git checkout -b testbranch #create a new branch
git remote add template ../cheatsheet-template
git fetch template
git merge template/master #now I got the template project as branch in the base project现在的问题是如何让vim-cheatsheet项目基于项目本身创建的模板。
我想要的是:
发布于 2012-12-13 14:43:15
在您的示例中,由于您有两个分支而没有一个共同的祖先,所以您可以尝试并在模板/主( rebase --onto )之上设置当前的主(“template”是远程引用模板回购的名称)。
这是"How to merge two branches without a common ancestor?“中提出的解决方案之一。
这样,这两个分支将有一个共同的历史记录,当您的模板更改时,您将能够这样做git pull --rebase (在修改后的获取模板之上重新设置当前工作的基础)。
最后,我创建了一个新项目并复制了源代码。
https://stackoverflow.com/questions/13861456
复制相似问题