05.03.2026 | Lothar Ferreira Neumann

Update a diverged local branch from remote to be on track again

stagePush.sh
git fetch --all
git checkout stage
# This resets your local stage branch to the version of remote.
# The origin/stage could diverge from the local due to resetting the branch.
git reset --hard origin/stage
git merge origin/BRANCHNAME
git push origin stage
git checkout BRANCHNAME

Issue:

We want to make sure the local 'stage' branch is updated with the latest changes from a specific remote branch before pushing updates back to the 'stage' branch in the repository.

Solution:

The code snippet updates the local 'stage' branch with the latest changes from the remote 'stage' branch, merges updates from another specified branch and pushes these combined updates back to the remote 'stage' branch. Finally, it switches back to the original branch.

Weitere DevBits

13.11.2025 | Peter Majmesku

Install the Latest GitFlow Version on macOS

sh
15.01.2026 | Mathias Grab

Show installed module information via composer

terminal.sh
# Syntax.
composer show vendor/package

# Example.
composer show drupal/eca

terminal_result.sh
name     : drupal/eca
descrip. : Event, Conditions, Actions - powerful, versatile, and user-friendly rules engine for Drupal
keywords : 
versions : * 2.1.0
type     : drupal-module
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
homepage : https://www.drupal.org/project/eca
source   : [git] https://git.drupalcode.org/project/eca.git 2.1.0
dist     : [zip] https://ftp.drupal.org/files/projects/eca-2.1.0.zip 2.1.0
path     : /var/www/html/web/modules/contrib/eca
names    : drupal/eca

support
source : https://drupal.org/project/eca
issues : https://drupal.org/project/issues/eca

requires
dragonmantank/cron-expression ^3.1
drupal/core ^10.3||^11
ext-dom *
ext-json *
mtownsend/xml-to-array ^2.0
php >=8.1

requires (dev)
drupal/eca_ui *
drupal/entity_reference_revisions ^1.12
drupal/inline_entity_form ^3.0
drupal/paragraphs ^1.18
drupal/token ^1.15
drupal/webform dev-3465838-drupal-11-compatibility

sh
composer