Updating Drupal with Git

I am trying to figure out how to use a Drupal mirror on a Git hub. I am new to Git, but developed the following:

Configure Grup Drupal Repository

* git init * git remote add drupal 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 kernel

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

My_sites kernel update

 * git checkout <my_site> * git rebase master 

I keep a separate branch for each of my sites. Each branch simply stores a separate directory of sites, because I do not crack the kernel. I experimented, and it looks like I could do everything as a merger without conflict, but my limited reading makes me sound like the correct answer.

I am not interested in developing a module in this repo. I do not support it on my server for direct deployment. I save it locally for testing updates and as source material for a shell script for deployment.

What do the right solutions look like?

+4
source share
1 answer

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

If this is not just a single repo and you (presumably) share branches, this will become a problem when you try push/pull , since the remote branches will have the latest known history. It is very dirty, very fast. If you plan to have more than one repo, simply merge the master branch to the branches of your site to update them. You can do it as often as you like.

Hope this helps.

+1
source

Source: https://habr.com/ru/post/1308698/


All Articles