Skip to content

Instantly share code, notes, and snippets.

@bradrhodes
bradrhodes / git-reset-author.sh
Created December 17, 2019 02:59 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
# Creates a better, more succinct log output
# git logg
git config --global alias.logg 'log --abbrev-commit --decorate --oneline --graph'
# Creates a better, more succinct log output for all branches
# git la
git config --global alias.logg 'log --abbrev-commit --decorate --oneline --graph --all'
# Concise git status
git config --global alias.ss 'status -s'
@bradrhodes
bradrhodes / gist:9990d64fc1fdc89ff03ffe6a815817c7
Created November 8, 2018 20:38
Clean .orig files after merge
find . -name '*.orig' -delete
@bradrhodes
bradrhodes / ConEmuTabFix
Created December 21, 2015 15:40
This will fix the name of the tabs in ConEmu to be the current working directory
# Run this command in bash to create the .bash_profile file and add the necessary entry to it
echo "PROMPT_COMMAND='ConEmuC -StoreCWD'" >> ~/.bash_profile
@bradrhodes
bradrhodes / BoxStarterExample
Last active October 29, 2018 22:10
Example BoxStarter Script
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
cinst git
cinst vscode
cinst conemu
cinst fiddler
cinst googlechrome
cinst spotify
cinst mremoteng
cinst todoist
@bradrhodes
bradrhodes / Remove files in .gitignore from repo
Created June 12, 2014 20:31
Remove files in .gitignore from repo
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
// Note that you need to commit any staged changes before doing this
// Note the . at the end of the first line, this is important for removing all cached files.
@bradrhodes
bradrhodes / P4Merge Git
Created April 24, 2014 15:52
Setup p4merge as mergetool and difftool for git in windows. Same as https://gist.github.com/daredude/1350855 but with the extra quotes removed. Works for me in Windows 7.
git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED'
git config --global diff.tool p4merge
git config --global difftool.p4merge.cmd 'p4merge.exe $BASE $LOCAL $REMOTE $MERGED'