you are here: codestackercodes [RSS] → tag git [RSS]

replace git author using shell script

#!/bin/sh

git filter-branch -f --env-filter '

an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"

if [ "$GIT_COMMITTER_EMAIL" = "old@email.com" ]
then
  cn="New author name"
  cm="new@email.com"
fi

export GIT_AUTHOR_NAME="$an"
export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_NAME="$cn"
export GIT_COMMITTER_EMAIL="$cm"
'

echo "Run after"
echo "git push origin +master:master"

git log for humans

git log --graph --format=format:'%C(yellow)%h%C(reset) %C(red)- %an%C(reset) - %C(white)%s%C(reset) %C(bold yellow)%d%C(reset) %C(green)(%ar)%C(reset)' --abbrev-commit --date=short

basic git commands

git init
git add *
git commit -a -m "initial commit"
git remote add origin git@github.com:leonardofaria/Helvetica2010.git
git push origin master

git add file.php
git status
git commit -a -m "added file.php"
git push
Displaying all 3 Code