Git tricks

  • Posted on: 28 April 2016
  • By: Michał Turecki

Inspired by spring cleaning of a collection of "New Text Document (n).txt" files on my desktop I decided to prepare a collection of git useful scripts, yet another. Here is the list:

  1. Replace git commit user name and email address in a branch history:

    #!/bin/sh
    
    git filter-branch --env-filter '
    OLD_EMAIL="not@used.anymore"
    CORRECT_NAME="My Name"
    CORRECT_EMAIL="my@new.email"
    if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
    then
        export GIT_COMMITTER_NAME="$CORRECT_NAME"
        export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
    fi
    if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
    then
        export GIT_AUTHOR_NAME="$CORRECT_NAME"
        export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
    fi
    ' --tag-name-filter cat master --branches --tags
    
Tags: 

Comments

Cheap Misoprostol Online Drugstore Flagyl Pay By Money Order cialis 20mg price at walmart Amoxicillin And Asthma Clomid Prescription Overnight What Is Amoxicillin Used

Cheap Misoprostol Online Drugstore Flagyl Pay By Money Order cialis 20mg price at walmart Amoxicillin And Asthma Clomid Prescription Overnight What Is Amoxicillin Used

Tadapox On Line Generic Levitra 40 Mg No Prescription Clomid Fast Delivery buy viagra Buy Obestat 10 Mg Buy Cheap Synthroid No Prescription Buy Suhagra Online India

Propecia While On Nodular Acne Canada Pharmacy Tadacip 10mg Paypal Discount Online Real Hydrochlorothiazide Hypertension Get Drugs Overseas viagra Cialis 2.5 Mg From Canada Real Viagra 150mg Blue

Propecia While On Nodular Acne Canada Pharmacy Tadacip 10mg Paypal Discount Online Real Hydrochlorothiazide Hypertension Get Drugs Overseas viagra Cialis 2.5 Mg From Canada Real Viagra 150mg Blue

Order Now Macrobid Bacterial Infections Amex Accepted Free Shipping Progesterone Medication cialis from canada Stendra Ed Best Website Prix Du Viagra 100mg

Order Now Macrobid Bacterial Infections Amex Accepted Free Shipping Progesterone Medication cialis from canada Stendra Ed Best Website Prix Du Viagra 100mg