-
-
Save lsavino/77ac7bdc4751d0b504233df1be097ca6 to your computer and use it in GitHub Desktop.
Setup for bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Link to project: | |
git://github.com/lsavino/git-poems.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git prompt command from: | |
# https://github.com/git/git/blob/8976500cbbb13270398d3b3e07a17b8cc7bff43f/contrib/completion/git-prompt.sh | |
source ~/.git-prompt.sh | |
GIT_PS1_SHOWDIRTYSTATE=1 | |
GIT_PS1_SHOWCOLORHINTS=1 | |
GIT_PS1_SHOWUNTRACKEDFILES=1 | |
PROMPT_COMMAND='__git_ps1 "\u@\h:\W" "\\\$ "' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
# Shows git history as a graph (with summarized commits) | |
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short | |
# Shows the source of added changes | |
staged = diff --staged | |
# Lists all your aliases | |
alias=!git config --list | grep alias | |
# Creates a zipped file of the whole repo (git history included) one level up from the current directory | |
panic = !tar cvf ../git_panic.tar . | |
# Abbreviations | |
st=status | |
br=branch | |
[user] | |
name = Laura Savino | |
email = lau.rasavino@gmail.com | |
[core] | |
excludesfile = /Users/savinola/.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are aliases for an in-workshop game that sometimes throws away all your changes 😇 | |
[alias] | |
# Permanently removes all uncommitted changes | |
throwitallaway = "!f(){ git reset --hard HEAD && git clean -fd; };f" | |
# Unstages all work, adds a line to a random file in the repo, & commits the result | |
badapple = "! files=(./*);"\ | |
"randfile=\"${files[RANDOM % ${#files[@]}]}\";"\ | |
"echo \"BOO!!\" >> $randfile;"\ | |
"git reset --soft HEAD;"\ | |
"git add $randfile;"\ | |
"git commit -m \"OH NO THIS COMMIT SHOULD NOT BE HERE\";"\ | |
"echo \"\n\noh dear, something seems to have been committed by mistake...\n\n\";" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment