Skip to content

Commit 68b2cde

Browse files
authored
Set SSH default in gh auth command (#490)
* Set SSH default in gh auth command Currently students have to select the protocol in the interactive questions asked by `gh`. The first option is HTTP, and regularly is chosen by accident instead of SSH. This remains undetected until late in the setup, or even later, and then requires several steps (especially if challenge repos have already been created). This commit sets the correct protocol in the command, so it no longer needs to be set in the interactive questions. * Format gh questions as list
1 parent 0e22b46 commit 68b2cde

File tree

5 files changed

+38
-39
lines changed

5 files changed

+38
-39
lines changed

_partials/cn/gh_cli.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@ CLI是[Command-line Interface(命令行界面)](https://baike.baidu.com/item
1111
:warning: **不要更改下面指令中的`email`**
1212

1313
```bash
14-
gh auth login -s 'user:email' -w
14+
gh auth login -s 'user:email' -w --git-protocol ssh
1515
```
1616

17-
gh会问你几个问题
17+
`gh`会问你几个问题
1818

19-
`What is your preferred protocol for Git operations?(你要用什么协议来执行Git操作?)` 让箭头`>`停在`SSH`前面,然后敲击回车。SSH使用SSH密钥来登陆用户,而不是用用户名和密码
19+
- `Generate a new SSH key to add to your GitHub account?(生成新的SSH密钥,然后添加到Github账号上?)` 敲击回车,让gh帮你生成
2020

21-
`Generate a new SSH key to add to your GitHub account?(生成新的SSH密钥,然后添加到Github账号上?)` 敲击回车,让gh帮你生成
21+
如果你以前生成过SSH密钥,那你就会看到这个问题`Upload your SSH public key to your GitHub account?(上传公共密钥到Github账户上上吗?)` 上下移动箭头`>`,让它停在你想选的SSH公钥前面,然后敲击回车
2222

23-
如果你以前生成过SSH密钥,那你就会看到这个问题`Upload your SSH public key to your GitHub account?(上传公共密钥到Github账户上上吗?)` 上下移动箭头`>`,让它停在你想选的SSH公钥前面,然后敲击回车。
23+
- `Enter a passphrase for your new SSH key (Optional)(输入新的SSH密钥的密码(非必填))`. 输入一个密码,然后写下来或者记住它。这是保护你本地私钥的密码。然后敲击回车。
2424

25-
`Enter a passphrase for your new SSH key (Optional)(输入新的SSH密钥的密码(非必填))`. 输入一个密码,然后写下来或者记住它。这是保护你本地私钥的密码。然后敲击回车。
26-
27-
`Title for your SSH key`。你可以把它留在建议的 "GitHub CLI",按`Enter`
25+
- `Title for your SSH key`。你可以把它留在建议的 "GitHub CLI",按`Enter`
2826

2927
然后你会看到下面的文字输出:
3028

_partials/es/gh_cli.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wik
44

55
En esta sección usaremos [GitHub CLI](https://cli.github.com/) para interactuar directamente con GitHub desde la terminal.
66

7+
Usaremos la GitHub CLI (`gh`) para conectarnos a GitHub utilizando *SSH*, un protocolo para iniciar la sesión utilizando claves SSH en lugar de la famosa pareja nombre de usuario y contraseña.
8+
79
Ya debería haberse instalado en tu computadora con los comandos que ejecutaste anteriormente.
810

911
Lo primero que hay que hacer para **iniciar sesión** es copiar y pegar el comando siguiente en tu terminal:
1012

1113
:warning: **NO edites el `email`**
1214

1315
```bash
14-
gh auth login -s 'user:email' -w
16+
gh auth login -s 'user:email' -w --git-protocol ssh
1517
```
1618

17-
gh le hará algunas preguntas:
18-
19-
`What is your preferred protocol for Git operations?` Con las flechas, elige `SSH` y presiona `Enter`. SSH es un protocolo para iniciar la sesión utilizando claves SSH en lugar de la famosa pareja nombre de usuario y contraseña.
19+
`gh` le hará algunas preguntas:
2020

21-
`Generate a new SSH key to add to your GitHub account?` Presiona `Enter` para pedirle a gh que genere las claves SSH por ti.
21+
- `Generate a new SSH key to add to your GitHub account?` Presiona `Enter` para pedirle a gh que genere las claves SSH por ti.
2222

23-
Si ya tienes claves SSH, verás en su lugar `Upload your SSH public key to your GitHub account?`Con las flechas, selecciona la ruta de tu archivo de clave pública y pulsa `Intro`.
23+
Si ya tienes claves SSH, verás en su lugar `Upload your SSH public key to your GitHub account?`Con las flechas, selecciona la ruta de tu archivo de clave pública y pulsa `Intro`.
2424

25-
`Enter a passphrase for your new SSH key (Optional)`. Pon algo que quieras y que recuerdes. Es una contraseña para proteger tu private key que está almacenada en tu disco duro. Luego presiona `Enter`.
25+
- `Enter a passphrase for your new SSH key (Optional)`. Pon algo que quieras y que recuerdes. Es una contraseña para proteger tu private key que está almacenada en tu disco duro. Luego presiona `Enter`.
2626

27-
`Title for your SSH key`. Puede dejarlo en la propuesta "GitHub CLI", presiona `Enter`.
27+
- `Title for your SSH key`. Puede dejarlo en la propuesta "GitHub CLI", presiona `Enter`.
2828

2929
Obtendrás el siguiente resultado:
3030

_partials/fr/gh_cli.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ CLI est l’acronyme de [Command-line Interface](https://en.wikipedia.org/wiki/C
44

55
Dans cette section, tu vas installer [GitHub CLI](https://cli.github.com/) pour interagir avec GitHub directement depuis le terminal.
66

7+
Nous allons utiliser GitHub CLI (`gh`) pour nous connecter à GitHub en utilisant *SSH*, un protocole pour s'authentifier en utilisant des clés SSH au lieu de la fameuse paire nom d'utilisateur et mot de passe.
8+
79
Elle doit déjà être installée sur ton ordinateur grâce aux commandes précédentes.
810

911
Pour **te connecter**, commence par copier-coller la commande suivante dans ton terminal :
1012

1113
:warning: **NE modifie PAS `email`**
1214

1315
```bash
14-
gh auth login -s 'user:email' -w
16+
gh auth login -s 'user:email' -w --git-protocol ssh
1517
```
1618

17-
gh va te poser quelques questions :
18-
19-
`What is your preferred protocol for Git operations?` Avec les flèches, choisis `SSH` et appuie sur `Enter`. SSH est un protocole pour s'authentifier en utilisant des clés SSH au lieu de la fameuse paire nom d'utilisateur et mot de passe.
19+
`gh` va te poser quelques questions :
2020

21-
`Generate a new SSH key to add to your GitHub account?` Appuie sur `Enter` pour demander à gh de générer les clés SSH pour toi.
21+
- `Generate a new SSH key to add to your GitHub account?` Appuie sur `Enter` pour demander à gh de générer les clés SSH pour toi.
2222

23-
Si tu as déjà des clés SSH, tu verras à la place `Upload your SSH public key to your GitHub account?` Avec les flèches, sélectionne le chemain de ta clé publique et appuie sur `Enter`.
23+
Si tu as déjà des clés SSH, tu verras à la place `Upload your SSH public key to your GitHub account?` Avec les flèches, sélectionne le chemain de ta clé publique et appuie sur `Enter`.
2424

25-
`Enter a passphrase for your new SSH key (Optional)`. Saisis un mot de passe dont tu te souviendras. Ce mot de passe sert à protéger ta clé privée enregistrée sur ton disque sur. Ensuite, appuie sur `Enter`.
25+
- `Enter a passphrase for your new SSH key (Optional)`. Saisis un mot de passe dont tu te souviendras. Ce mot de passe sert à protéger ta clé privée enregistrée sur ton disque sur. Ensuite, appuie sur `Enter`.
2626

27-
`Title for your SSH key`. Tu peux laisser ce qui est proposé par défaut, à savoir "GitHub CLI", appuie sur `Enter`.
27+
- `Title for your SSH key`. Tu peux laisser ce qui est proposé par défaut, à savoir "GitHub CLI", appuie sur `Enter`.
2828

2929
Tu obtiendras le résultat suivant :
3030

_partials/gh_cli.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ In this section, we will use [GitHub CLI](https://cli.github.com/) to interact w
66

77
It should already be installed on your computer from the previous commands.
88

9+
We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol to log in using SSH keys instead of the well known username/password pair.
10+
911
First in order to **login**, copy-paste the following command in your terminal:
1012

1113
:warning: **DO NOT edit the `email`**
1214

1315
```bash
14-
gh auth login -s 'user:email' -w
16+
gh auth login -s 'user:email' -w --git-protocol ssh
1517
```
1618

17-
gh will ask you few questions:
18-
19-
`What is your preferred protocol for Git operations?` With the arrows, choose `SSH` and press `Enter`. SSH is a protocol to log in using SSH keys instead of the well known username/password pair.
19+
`gh` will ask you few questions:
2020

21-
`Generate a new SSH key to add to your GitHub account?` Press `Enter` to ask gh to generate the SSH keys for you.
21+
- `Generate a new SSH key to add to your GitHub account?` Press `Enter` to ask gh to generate the SSH keys for you.
2222

23-
If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`.
23+
If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`.
2424

25-
`Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`.
25+
- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`.
2626

27-
`Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`.
27+
- `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`.
2828

2929
You will then get the following output:
3030

_partials/pt/gh_cli.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,28 @@ CLI é o acrônimo de [Interface de linha de comando](https://en.wikipedia.org/w
44

55
Nesta seção, usaremos [GitHub CLI](https://cli.github.com/) para interagir com o GitHub diretamente do terminal.
66

7+
Usaremos o GitHub CLI (`gh`) para conectar ao GitHub usando *SSH*, um protocolo para fazer login usando chaves SSH em vez do conhecido par nome de usuário/senha.
8+
9+
710
Ele já deve estar instalado no seu computador a partir dos comandos anteriores.
811

912
Primeiro, para **fazer login**, copie e cole o seguinte comando em seu terminal:
1013

1114
:warning: **NÃO edite o `email`**
1215

1316
```bash
14-
gh auth login -s 'user:email' -w
17+
gh auth login -s 'user:email' -w --git-protocol ssh
1518
```
1619

1720
`gh` fará algumas perguntas:
1821

19-
`What is your preferred protocol for Git operations?` Com as setas, escolha `SSH` e pressione `Enter`. SSH é um protocolo para fazer login usando chaves SSH em vez do conhecido par nome de usuário/senha.
20-
21-
`Generate a new SSH key to add to your GitHub account?` Pressione `Enter` para pedir ao gh para gerar as chaves SSH para você.
22+
- `Generate a new SSH key to add to your GitHub account?` Pressione `Enter` para pedir ao gh para gerar as chaves SSH para você.
2223

23-
Se você já possui chaves SSH, verá `Upload your SSH public key to your GitHub account?` Com as setas, selecione o caminho do arquivo de sua chave pública e pressione `Enter`.
24+
Se você já possui chaves SSH, verá `Upload your SSH public key to your GitHub account?` Com as setas, selecione o caminho do arquivo de sua chave pública e pressione `Enter`.
2425

25-
`Enter a passphrase for your new SSH key (Optional)`. Digite algo que você deseja e que você lembrará. É uma senha para proteger sua chave privada armazenada no disco rígido. Em seguida, pressione `Enter`.
26+
- `Enter a passphrase for your new SSH key (Optional)`. Digite algo que você deseja e que você lembrará. É uma senha para proteger sua chave privada armazenada no disco rígido. Em seguida, pressione `Enter`.
2627

27-
`Title for your SSH key`. Você pode deixá-lo no "GitHub CLI" proposto, pressione `Enter`.
28+
- `Title for your SSH key`. Você pode deixá-lo no "GitHub CLI" proposto, pressione `Enter`.
2829

2930
Você obterá então a seguinte saída:
3031

0 commit comments

Comments
 (0)