Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a private git repository with Stack

I'm trying to configure stack to use the Haskell packages of a private git repository. Looking at the documentation it seems that the git repository can be added as local dependency. The problem is that I see no way of specifying the credentials for logging into the server.

What is the right way of adding packages of a private git repository using stack?

EDIT: For the sake of completeness I add the section of stack.yaml that edited to be able to use a private repository:

packages:
- '.'
- location:
    git: ssh://[email protected]:7999/project/subproject.git
    commit: 4ac0e47bfd3
  subdirs:
  - subdir-of-the-private-package
  extra-dep: true

As @renegadeborealis pointed out, the authentication is taken care of outside of Stack.

like image 575
Damian Nadales Avatar asked Dec 28 '16 22:12

Damian Nadales


People also ask

Can I use GitHub private repository?

GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

Can you fork into a private repository?

Yes. You should be able to add the other repo as a new (tracking) remote (eg. 'other-repo')and then periodically fetch and merge changes from it (eg. 'git merge other-repo/stable').

How do I clone a private git repository in Visual Studio code?

Clone repository Open the command palette with the key combination of Ctrl + Shift + P . At the command palette prompt, enter gitcl , select the Git: Clone command, and press Enter. When prompted for the Repository URL, select clone from GitHub, then press Enter.


1 Answers

You'll set the authentication in Git itself, not in stack.

If you're using git over ssh, you can set authentication options in ~/.ssh/config

Host me.github.com
    HostName github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/me_rsa

Here's some good reading if you need more. Good luck!

like image 121
renegadeborealis Avatar answered Sep 17 '22 12:09

renegadeborealis