Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminal Mathias’s dotfiles .functions

I recently got Mathias’s dotfiles on my terminal, and I mainly have two questions about this repo.

First: I can't make my custom aliases / functions get to work. I writing them in the default location of Mathias’s dotfiles, in .aliases / .functions. I do reload .bash_profile after I added and saved the code.

Second: How can I keep up to date with updates automatically while in the meanwhile I have custom aliases and functions setup in .aliases / .functions at the default location of Mathias’s repo. ( /Users/TheSpiritMolecule/dotfiles )

like image 275
aegyed Avatar asked Feb 16 '23 02:02

aegyed


1 Answers

Glad to hear you like my dotfiles :)

First: I can't make my custom aliases / functions get to work. I writing them in the default location of Mathias’s dotfiles, in .aliases / .functions. I do reload .bash_profile after I added and saved the code.

What have you tried? Please describe in detail what you did exactly: which files you edited, which aliases/functions you added. Are you sure you’re editing the ~/.aliases and ~/.functions and not the files in the repository?

Second: How can I keep up to date with updates automatically while in the meanwhile I have custom aliases and functions setup in .aliases / .functions at the default location of Mathias’s repo. ( /Users/TheSpiritMolecule/dotfiles )

The idea is that you don’t use my dotfiles directly, but rather create your own fork of my repository. That way, you can always merge any changes that I made, and that you like, back into your fork through the magic that is Git.

If for some reason you really don’t want to create a fork, you can still add custom aliases and functions by creating an ~/.extra file. That file will never be part of the repository so it won’t cause any merge conflicts, but my dotfiles will source it if such a file exists, along with the other files. You can use this to add a few custom commands without the need to fork this entire repository, or to add commands you don’t want to commit to a public repository.

My ~/.extra looks something like this:

# Git credentials
# Not in the repository, to prevent people from accidentally committing under my name
GIT_AUTHOR_NAME="Mathias Bynens"
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
git config --global user.name "$GIT_AUTHOR_NAME"
GIT_AUTHOR_EMAIL="[email protected]"
GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
git config --global user.email "$GIT_AUTHOR_EMAIL"

You could also use ~/.extra to override settings, functions and aliases from my dotfiles repository. It’s probably better to fork this repository instead, though.

like image 134
Mathias Bynens Avatar answered Mar 05 '23 16:03

Mathias Bynens