Skip to content

Instantly share code, notes, and snippets.

@genadyp
Created June 30, 2024 07:48
Show Gist options
  • Save genadyp/f59161121810901d1e43b0871cfc0f5c to your computer and use it in GitHub Desktop.
Save genadyp/f59161121810901d1e43b0871cfc0f5c to your computer and use it in GitHub Desktop.

Revisions

  1. genadyp created this gist Jun 30, 2024.
    14 changes: 14 additions & 0 deletions git.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    ## How-to migrate git branch to another name

    ```console
    # resource_db_dev -> staging
    # resource_db_prod -> main
    # Please run following commands in your local env to update copies.

    git branch -m resource_db_dev staging
    git branch -m resource_db_prod main
    git fetch origin
    git branch -u origin/main main
    git branch -u origin/staging staging
    git remote set-head origin -a
    ```