开发者

Keeping Drupal updated with Git

I'm trying to figure out how to use the Drupal mirror on Git hub. I'm new to git but have worked out the following:

Set up a git Drupal repo

* git init
* git remote add dr开发者_如何学Goupal git://github.com/drupal/drupal.git
* git fetch drupal

* git tag
* git merge <tag_name>

Make a branch for my site

* git branch <my_site>
* git checkout <my_site>
* git add .
* git commit -a

Update core

* git checkout master
* git fetch drupal
* git tag
* git merge <new_versions_tag>

Update my_site’s core

* git checkout <my_site>
* git rebase master

I'm keeping a separate branch for each of my sites. Each branch just keeps a separate sites directory because I'm not hacking core. I've done some experimenting and it looks like I could do everything as a merge without conflict but my limited reading makes rebase sound like the right answer.

I'm not interested in doing module development in this repo. I'm not keeping it on my server for direct deployment. I'm keeping it locally for upgrade testing and as raw material for a shell script to deploy from.

Do these look like the right solutions?


The rebase versus merge decision really comes down to whether or not you want to rewrite your branch's history every time you upgrade. If you just have the one repo, this may be a personal decision. See git-rebase for more information on how your history is rewritten.

If this isn't going to be just a single repo, and you (presumably) are sharing the branches, this will become a problem when you try to push/pull as the remote branches will have the last known history. This gets very dirty, very quick. If you plan on having more than one repo, just merge the master branch into your site branches to update them. You can do this as often as you like.

Hope that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜