ionic-team / ionic-team/ionic-cli

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

未關閉
#2,829 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

**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
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。