Git ๐งฉ 1c – Initial Git Configuration
After installing Git, you should configure your user name and email address. This information is embedded in every commit you make, identifying you as the author.
1. Set your user name
git config --global user.name "Your Name"
Replace `"Your Name"` with your actual name. This should be the name you want to appear in your commits.
2. Set your email address
git config --global user.email "your.email@example.com"
Replace `"your.email@example.com"` with the email address you want associated with your Git commits. This email is often linked to your GitHub/GitLab/Bitbucket account.
3. Configure Text Editor
You can set up a default text editor for commit messages.
For VS Code:
git config --global core.editor "code --wait"
For Sublime Text:
git config --global core.editor "subl -n -w"
For Vim:
git config --global core.editor "vim"
4. Configure Aliases
Create shortcuts for frequently used Git commands to increase efficiency.
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
Now, you can use git co instead of git checkout, git br for branches, and so on.
5. Enable Auto-Correct
Git can help correct typos in commands. This setting will suggest the correct command if you make a small typo.
git config --global help.autocorrect 1
6. Set Default Branch Name
Starting with Git 2.28, you can set the default branch name to something other than master.
git config --global init.defaultBranch main
Or for any other preferred branch name:
git config --global init.defaultBranch "development"
7. Configure SSH Key
Using an SSH key can simplify authentication when pushing and pulling from remote repositories.
Generate SSH Key:
ssh-keygen -t rsa -b 4096 -C "your.email@example.com"
Follow the prompts to save the key (usually ~/.ssh/id_rsa).
Add SSH Key to SSH Agent:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
Copy the SSH public key and add it to your GitHub/GitLab account.
8. Verify your configuration
To see all your global Git configurations, run:
git config --global --list
You should see your `user.name` and `user.email` listed.
You are now ready to start using Git for your projects!
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!