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 trialEric Drake
6,339 PointsHow do I configure a local git repo to allow it to be cloned?
I have a repo on a development server that I would like to clone onto my local dev environment. Whenever I try to clone the repo using "git clone ll.com dev.ll.com", I'm told that "repository 'll.com' does not exist". How do I configure my repo to be cloned? What command do I use to clone it to a local dev environment?
1 Answer
Ari Misha
19,323 PointsHello there! You simply have to create a Git remote repo, maybe on Github or even Bitbucket. Followed by a push to the origin and as soon as your repo is ready on github/bitbucket, it'll be available for cloning. Follow the steps down below to achieve this:
git commit -am "Your commit message here"
git remote add origin git repo url here
git remote -v // to confirm whether the origin is created
git push origin master // push the branch to the origin
If you don't have Github account, I highly recommend you make one. Also, in order to configure your local git bash with your Github account, you probably have to generate new SSH keys for shell authentication, so that Github can recognize you and link you with your account. Here are the steps to on How to configure your local bash with your github acount.
I hope it helped! ~ Ari
Eric Drake
6,339 PointsEric Drake
6,339 PointsThanks for the reply. I was able to use some of what you suggested to create the remote repo. I'm still having problems cloning the repo from my local environment. I get the following error "fatal: http://ll.com/.git/info/refs not valid: is this a git repository?" I believe that this problem stems from the framework I'm using. The .git folder is in actual root folder of my project, but all web traffic is redirected to the public folder. Do you know a way around this?
Ari Misha
19,323 PointsAri Misha
19,323 PointsEric Drake Did you attach your authentication SSH keys for the github? You can check by typing:
~ Ari
Eric Drake
6,339 PointsEric Drake
6,339 PointsAri,
Thanks for your suggestions. I would prefer not to use GitHub for my development work. The projects in question are corporate intranet websites. I'd like to keep my repos on a local server.
Ari Misha
19,323 PointsAri Misha
19,323 PointsEric Drake Maybe you just need a private Repo, right? Or Give SVN a try if you'd like to keep it on a local server. (:
Eric Drake
6,339 PointsEric Drake
6,339 PointsAri,
Git now works on my local dev environment how I had hoped. With your pointers, I was able to create a remote repo. My issue with cloning that repo came due to some complications with my PHP framework. (The framework used the "public" subdirectory as its web root directory; the .git file needed to clone the repo was located in the root directory of the site and was not visible using http). I was able to configure the remote repo to allow itself to be cloned using SSH instead of HTTP. From then on, I've been able to clone the repo without any issues.
Thanks again for your help.