bookmarks/cheat/git.md
2019-11-21 03:55:35 +01:00

616 B

Undo last commit while keeping changes

git reset HEAD^

Get latest submodules changes (src)

git submodule foreach git pull origin master

Most active hours from git history (src)

git log --author="Morgan" \
        --format="%ad" \
        --date="format:%H" |\
        awk '{n=$1+0;if(H[n]++>max)max=H[n]}END{for(i=0;i<24;i++){printf"%02d -%5d ",i,H[i];for(n=0;n<H[i]/max*50;n++){printf "*"}print""}}'