开发者

How to keep Drupal up to date with the GitHub repo?

开发者 https://www.devze.com 2022-12-20 06:12 出处:网络
Drupal has a GitHub repository at http://github.com/drupal/drupal I, being a newbie to Git and the DVCS world in general, and having 开发者_运维技巧trouble figuring out how to use this repo as a meth

Drupal has a GitHub repository at http://github.com/drupal/drupal

I, being a newbie to Git and the DVCS world in general, and having 开发者_运维技巧trouble figuring out how to use this repo as a method for keeping my Drupal core up to date, so I have the following questions:

  • Is this the best way to check out a specific tag from the repo?

    git clone git://github.com/drupal/drupal.git`
    git checkout DRUPAL-6-15
    
  • How about updating to the next release when it becomes available? Just git checkout DRUPAL-6-16?

  • How can I choose to save my own changes (such as modifications to .htaccess) rather than revert back whenever I update?

  • What's the best way to add my modules and themes into my local git repo, and still retain the ability to update core whenever there's a new core release? Do I need to create a branch?


Is this the best way to check out a specific tag from the repo?

Yes. It is the right way.

How about updating to the next release when it becomes available? Just git checkout DRUPAL-6-16?

git checkout master
git pull
git tag # Lists all tags, contains releases
git checkout <tagname> # tagname seen in the previous output.

How can I choose to save my own changes (such as modifications to .htaccess) rather than revert back whenever I update?

One way would be to make all your modifications in a separate branch and merge those changes after you have checked out a release tag.

What's the best way to add my modules and themes into my local git repo, and still retain the ability to update core whenever there's a new core release? Do I need to create a branch?

You should use git submodule for this. Checkout this answer


For the record, drupal.org has a very nice guide which does not recommend submodules to keep up to date with core. You just dedicate a branch for this, and a remote pointing to git.drupal.org.

0

精彩评论

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

关注公众号