ionic-team / ionic-team/ionic-cli

Ionic doctor check trying to fix GIT repo origin that is actually working

Abierto
#2,829 1 comentario 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
TypeScript
Estrellas
2k
Forks
682
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Description:**
`$ ionic doctor check` is telling me my GIT config is wrong, but it's not true:
```bash
$ ionic doctor check
✔ Detecting issues: 16 / 16 complete - done!
Detected 2 issues.
[WARN] App linked to 57d1... with invalid git configuration.

This app is linked to an app on Ionic (57d1...), but the git configuration is not valid. To fix, the following
step(s) need to be taken:

1) Run: ionic git remote
```
This is because I'm using SSH key aliases for my hosts. I work with projects from different companies and Bitbucket doesn't allow the same SSH key for different accounts. This is my `~/.ssh/config`:
```
Host company1
HostName bitbucket.org
IdentityFile ~/.ssh/company1
Host company2
HostName bitbucket.org
IdentityFile ~/.ssh/company2
Host company1.ionic
HostName git.ionicjs.com
IdentityFile ~/.ssh/company1
Port 22
Host company2.ionic
HostName git.ionicjs.com
IdentityFile ~/.ssh/company2
Port 22
```
And this is my project's `.git/config`:
```
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@company1:company1/bla.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "ionic"]
url = git@company1.ionic:myname/bla.git
fetch = +refs/heads/*:refs/remotes/ionic/*
```
Of course I could use my personal SSH key for both projects in Ionic's repo (like ~/.ssh/id_rsa.pub or just create a new one), but I want my work projects worlds to be sepparated among them and from my personal projects (yet in other account).

I bet other Bitbucket users are going through the same, since this is the recommended method from them.
Origin of the issue: https://bitbucket.org/site/master/issues/5154/someone-has-already-registered-that-ssh
Bitbucket's proposed solution (I can't find it now but it was also in Confluence's official docs): https://developer.atlassian.com/blog/2016/04/different-ssh-keys-multiple-bitbucket-accounts/

**My `ionic info`:**
```
$ ionic info

cli packages: (/home/shamank/.nvm/versions/node/v8.2.1/lib/node_modules)

@ionic/cli-utils : 1.15.0
ionic (Ionic CLI) : 3.15.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms : android 6.2.3 browser 5.0.1 ios 4.4.0
Ionic Framework : ionic-angular 3.7.1

System:

Android SDK Tools : 26.1.1
Node : v8.2.1
npm : 4.6.1
OS : Linux 3.19

Environment Variables:

ANDROID_HOME : /home/shamank/Android/Sdk

Misc:

backend : pro
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start with the `ionic doctor check` command and the `.git/config` example in the issue, then locate the validation of the `ionic` remote and how SSH host aliases are handled. Reproduce the warning with an aliased host such as `company1.ionic`; done means a working aliased remote is not reported as invalid while genuinely incorrect configuration is still detected.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, typescript
Área
cli, devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.