Skip to content

Commit 8f47f60

Browse files
authored
Add GitHub setup instructions (#40)
2 parents b8a5c66 + 27c5e18 commit 8f47f60

File tree

1 file changed

+72
-12
lines changed

1 file changed

+72
-12
lines changed

04-materials/02-anatomy-of-extensions.md

Lines changed: 72 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,85 @@ micromamba activate jupyutercon2025
116116
micromamba install python pip nodejs gh "copier~=9.2" jinja2-time
117117
```
118118

119+
120+
### Set some important Git settings
121+
122+
123+
1. When you make commits, Git needs to know who you are.
124+
Configure identity information Git will use when you commit:
125+
126+
```bash
127+
git config --global user.email "[email protected]"
128+
git config --global user.name "Your Name Here"
129+
```
130+
131+
2. The modern conventional branch name is "main", and this tutorial will assume that's
132+
your default branch.
133+
Ensure your default branch is set to `main`:
134+
135+
```bash
136+
git config --global init.defaultBranch main
137+
```
138+
139+
119140
### Create a repository in GitHub and clone it
120141

142+
If you're an experienced Git & GitHub user, feel free to do this step the way you
143+
normally would!
144+
121145
0. Change to the parent directory where you want to work, e.g.
122146

123-
```bash
124-
cd ~/Projects
125-
```
147+
```bash
148+
cd ~/Projects
149+
```
126150

127-
1. Create a repository in GitHub and clone it
151+
1. If you don't already have GitHub authentication set up on your local machine,
152+
authenticate with GitHub.
128153

129-
```bash
130-
# TODO: Test
131-
gh repo create jupytercon2025-extension-workshop --public --clone
132-
```
154+
```bash
155+
gh auth login
156+
```
133157

134-
2. Change directory into your new repository
158+
Select reasonable defaults: `GitHub.com`, `HTTPS`, `Yes`, and `Login with a web browser`, then follow the
159+
instructions carefully.
135160

136-
```bash
137-
cd jupytercon2025-extension-workshop
138-
```
161+
Then, set up the Git CLI to authenticate with GitHub:
162+
163+
```bash
164+
gh auth setup-git
165+
```
166+
167+
2. Create a repository in GitHub and clone it:
168+
169+
```bash
170+
gh repo create jupytercon2025-extension-workshop --public --clone
171+
```
172+
173+
3. Change directory into your newly-cloned repository:
174+
175+
```bash
176+
cd jupytercon2025-extension-workshop
177+
```
178+
179+
4. Add some useful metadata to your repository:
180+
181+
```bash
182+
gh repo edit --add-topic "jupytercon2025" --add-topic "jupyterlab-extension"
183+
```
184+
185+
5. Get your cloned repository's URL:
186+
187+
```bash
188+
gh repo view
189+
```
190+
191+
The URL of your repo will be printed on the final line of output.
192+
Copy that URL for the next step!
193+
194+
:::{hint}
195+
Check out [GitHub authentication](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
196+
about SSH keys later if you get tired of typing username/password.
197+
:::
139198

140199

141200
### First, create a new extension from the [official template](https://github.com/jupyterlab/extension-template)
@@ -150,6 +209,7 @@ micromamba install python pip nodejs gh "copier~=9.2" jinja2-time
150209

151210
* Kind: `frontend-and-server`
152211
* Javascript package name: `jupytercon2025-extension-workshop`
212+
* Repository URL: as printed by the `gh repo view` command
153213

154214
Everything else can be left as default if you prefer.
155215

0 commit comments

Comments
 (0)