Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

APIs

How to recover deleted git repository of local matchine

I formatted my laptop and there was a remote Git repository that was deleted now. How do I get that same repository with same Git setup again with remote access? I was trying to clone my deleted repository with git clone ssh://<user>@<ip>/path/to/your/remote/repo – but it was showing Harshits-MacBook:~ harshitsingh$ ssh-copy-id root@ip /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/harshitsingh/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys Permission denied (publickey). Harshits-MacBook:~ harshitsingh$ git clone ssh://root@ip/https://github.com/user/path Cloning into 'path'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

5 Answers

Rebekah Smith
Rebekah Smith
7,263 Points

Are you using github to host your project? I found your user on github but you have no public repositories. https://github.com/harshitsingh

that's a not pubic project.

Rebekah Smith
Rebekah Smith
7,263 Points

Okay, since you know the repository exists, the issue must be with public key. Did you use the key provided by github? It should be in Github's upper right profile icon > Settings > SSH and GPG keys

this is my repository path https://github.com/Hsmith1947/upkarproject I already used ssh keys

Rebekah Smith
Rebekah Smith
7,263 Points

When I want a project from github, I almost always go with the Clone with HTTPS option and then import the url, but sometimes you need to Clone with SSH. Here's a good video by Chris where he shows cloning with SSH: https://teamtreehouse.com/library/weather-app-in-need-of-tests

Rebekah Smith
Rebekah Smith
7,263 Points

The ssh would look like: git clone git@github.com:Hsmith1947/upkarproject.git

If that doesn't work, I'm afraid I can't help, sorry ... there's good info here on Treehouse on using git with Java IDEs but the PHP ones don't look helpful

thank you so much for your time.