Skip to content

Commit ab43a89

Browse files
committed
Add more info to git section
1 parent e9d293a commit ab43a89

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

_posts/2023-03-18-configuring-a-new-mac.markdown

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ When setting up a new MacBook, there are a few steps you should take to get it u
1717
- [Safari](#safari)
1818
- [iTerm2](#iterm2)
1919
- [SSH Keys](#ssh-keys)
20+
- [Personal Access Token](#personal-access-token)
21+
- [Setting Git Config](#setting-git-config)
2022
- [Step 5: Configure Settings](#step-5-configure-settings)
2123
- [System Settings](#system-settings)
2224
- [Notifications](#notifications)
2325
- [Appearance](#appearance)
2426
- [Control Center](#control-center)
2527
- [Desktop and Dock](#desktop-and-dock)
28+
- [Display](#display)
2629
- [Keyboard](#keyboard)
2730
- [Trackpad](#trackpad)
28-
- [Display](#display)
2931
- [Siri and Spotlight](#siri-and-spotlight)
3032
- [Finder Settings](#finder-settings)
3133
- [In your User folder:](#in-your-user-folder)
@@ -97,6 +99,8 @@ If you are using SSH keys for your personal/work repositories:
9799

98100
Note: If you are using SourceTree, be careful with the auto-generated keys, they will probably not work. If you keep getting Access Denied with those keys, try following the steps described above instead.
99101

102+
### Personal Access Token
103+
100104
If, for some reason, the SSH keys do not work, and, you are in a hurry, there is a quick way to clone private repositories using Personal Access Tokens:
101105

102106
`git clone https://$YOUR_PAT@github.com/organization/repo.git`
@@ -105,6 +109,25 @@ This line could also be useful for CI systems:
105109

106110
`git config --global url."https://$GIT_PAT@github.com/".insteadOf [email protected]:`
107111

112+
### Setting Git Config
113+
114+
These lines are useful to set your git email/name:
115+
116+
**Globally:**
117+
- `git config --global user.email "your_email"`
118+
- `git config --global user.name "your_name"`
119+
120+
**For a single repo:**
121+
Run in the root of the repo:
122+
123+
- `git config user.email "your_email"`
124+
- `git config user.name "your_name"`
125+
126+
**To check the config:**
127+
128+
- `git config user.email`
129+
- `git config user.name`
130+
108131
# Step 5: Configure Settings
109132
Here's a list of recommended settings to customize:
110133

0 commit comments

Comments
 (0)