← Cheat Sheets

Git Setup and Config

First-time configuration and useful settings.

# Git Setup and Config

First-time configuration and useful settings.

```bash
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
git config --global core.editor "code --wait"
git config --global pull.rebase true
git config --global alias.st status
git config --list --show-origin
git init                         # new repository
git status -sb                   # short status
```

**.gitignore patterns**
```text
node_modules/    # a folder
*.log            # any .log file
!keep.log        # exception
/build           # only in the root
**/temp          # temp folder at any depth
.env
```