Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access private repo packages in flutter using ssh?

I have private repo in github, and use it as a packages in my project. in pubspec.yaml i write it like these.

dependencies:
  shared_preferences: ^0.4.3
  atomic_app_customer_musteat_id:
    git: [email protected]:organization/my_github_repo_ssh .git
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

but then the error is "Could not find a file named "pubspec.yaml" in my github_repo"

I have added ssh in my account, and trying to configuring machine user in github. Then I tried to change it to normal https link, and no errors. but when I tried build on ci/cd in bitrise and get error.

pub get failed (69) -- attempting retry 5 in 16 seconds...
Git error. Command: git fetch
fatal: not a git repository 

But still can't figure it out how to solve this issue.

like image 813
nhuluseda Avatar asked Feb 07 '19 02:02

nhuluseda


People also ask

How do I access a private repository?

Set up a GitHub SSH key. Add the public SSH key to a private repository's deploy keys. Store the private SSH key in Secret Manager. Submit a build that accesses the key from Secret Manager and uses it to access the private repository.

Can we view private GitHub repo?

You can give people collaborator access to repositories owned by your personal account. If you're using GitHub Free, you can add unlimited collaborators on public and private repositories.

How do you make a private package on flutter?

To create a flutter package, open your IDE and create a new flutter project. The only difference is to select Project Type as Package this time. In your package pubspec. yaml file, add publish_to: none to prevent publishing.


1 Answers

Use the url line like this:

dependencies:
  my_project:
    git:
      url: ssh://git@gitserver/path/my_project.git
like image 58
Richard Heap Avatar answered Sep 22 '22 19:09

Richard Heap