ionic-team / ionic-team/ionic-cli

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

Đang mở
#2,829 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
2k
Fork
682
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.