Open ~/.bash_profile in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
| export const deepMerge = (target, ...sources) => { | |
| if (!sources.length) { | |
| return target; | |
| } | |
| // making sure to not change target (immutable) | |
| const output = { ...target }; | |
| sources.forEach(source => { | |
| if (isObject(source)) { | |
| Object.keys(source).forEach(key => { | |
| if (isObject(source[key])) { |
| this.toBeScanned$ | |
| .scan(() => do something) | |
| .takeUntil(this.reset$) | |
| .repeat(); |
| Find the last commit that affected the given path. As the file isn't in the HEAD commit, this commit must have deleted it. | |
| git rev-list -n 1 HEAD -- <file_path> | |
| Then checkout the version at the commit before, using the caret (^) symbol: | |
| git checkout <deleting_commit>^ -- <file_path> | |
| Or in one command, if $file is the file in question. | |
| git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file" |
| # .env loading in the shell | |
| dotenv () { | |
| set -a | |
| [ -f .env ] && . .env | |
| set +a | |
| } | |
| # Run dotenv on login | |
| dotenv |