Skip to content

Instantly share code, notes, and snippets.

View MarcusJohnson91's full-sized avatar

Marcus Johnson MarcusJohnson91

View GitHub Profile
@MarcusJohnson91
MarcusJohnson91 / MakeGetVersionNumber.sh
Last active April 5, 2017 02:11
Gets the version number from a header and publishes it as VERSION in Make
VERSION := $(shell grep @version $(FILE_TO_GET_VERSION_NUMBER_FROM) | echo | grep -o '[0-9]\.[0-9]\.[0-9]')
# `@version` is a doxygen comment identifier in the header to get the version number from btw, it extracts the whole string, then the last grep command extracts just the number from it.
@MarcusJohnson91
MarcusJohnson91 / FixAuthorNameEmailInGit.sh
Last active March 25, 2020 23:45
Fixes the author and committer name and email in git
git filter-branch -f --env-filter '
CORRECT_NAME="YOUR_REAL_NAME"
CORRECT_EMAIL="YOUR_EMAIL_ADDRESS@WEBSITE.TLD"
if [ "$GIT_COMMITTER_EMAIL" != "$CORRECT_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" != "$CORRECT_EMAIL" ]
then
@MarcusJohnson91
MarcusJohnson91 / README.md
Created December 30, 2020 10:28 — forked from magnetikonline/README.md
Extract all files at every commit of a Git repository.

Extract all files at every commit of a Git repository

Bash script to iterate all commits of a given Git repository and extract all files within each commit.

Example

With a Git repository at /path/to/repository and an empty directory at /path/to/output we can run:

./export.sh /path/to/repository /path/to/output

Export 1d9048853b8073e43e43e3250300a82f93d2f431 -> /path/to/output/1d9048853b8073e43e43e3250300a82f93d2f431