Skip to content

Posts tagged git

Posts under this tag. Back to all posts when you want the full stream.

Posts

4 posts under this tag.

@latest_post

Basic Git configuration

To show where you global config file is:

Shell command
git config --list --show-origin

Set up our user and email:

Shell command
git config --global user.name "Your name goes here"
git config --global user.email "your@email.goes.here"

Set the default branch name for your new repos:

Shell command
git config --global init.defaultBranch main

Always git pull with rebase:

Shell command
git config --global pull.rebase true

Let's have colored output for git status and git diff:

Shell command
git config --global color.ui "auto"

Enable the automatic detection of CPU threads to use when packing repositories:

Shell command
git config --global pack.threads "0"

Define a global .gitignore file:

Shell command
git config --global core.excludesfile ~/.config/git/globalexcludes

Let's use it to ignore vscode project files and files generated by the ElixirLS plugin:

Shell command
echo ".vscode/" >> ~/.config/git/globalexcludes
echo ".elixir_ls/" >> ~/.config/git/globalexcludes
echo ".impeccable/" >> ~/.config/git/globalexcludes
Updated 3 min read
Start reading Read more