1

I can't clone my repository

I'll explain the steps what I've done
1) I'm using windows 8
2) Run Git Bash
3) $mkdir git_ball
4) $cd git_ball
5) $git init, returns Initialized empty Git repository in c:/Users/user1/git_ball/.git/
6) $ls > list.txt
7) $git add .
8) $git commit -m 'creation of list.txt'
9) $git config push.default matching
10) $git remote add origin /c/Users/user1/git_ball
11) $git config http.sslVerify "false"
12) $git push origin, it gives: everithing up-to-date
13) $cd ..
14) $git clone git://192.168.48.189/~/git_ball git_ball2 , (192.168.48.189 is the IP of my local machine)
it gives: Cloning into 'git_ball2'... fatal: unable to connect to 192.168.48.189: 192.168.48.189[0: 192.168.48.189]: errno=No such file or directory

I don't know what is missing, I want to clone git_ball using my IP, can you help me about this case. The idea also is cloning git_ball from another PC into the same LAN network using my IP.

Thanks

2
  • Can you clone if you replace the IP address with 127.0.0.1 instead? Commented Feb 5, 2015 at 16:03
  • Testing with 127.0.0.1, it didn't work, it shows the same output of fatal: unable to connect to 127.0.0.1... Commented Feb 5, 2015 at 16:33

1 Answer 1

1

You missed to configure a remote repository. Have a look at this link: http://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/. It is for Linux, but it seems you are using git bash so it should work.

Basically, you have to configure two repository on your local machine: the remote and the local repo. To configure the remote repository:

  1. mkdir remote-repo.git
  2. cd remote-repo.git
  3. git init --bare

At this point, you can repeat your procedure to create a local repository, where at point 10 you set the remote to point at remote-repo.git.

Sign up to request clarification or add additional context in comments.

4 Comments

Also, instead of repeating all points up to 10 he can just cd back in to git_ball and do a git remote set-url origin /c/Users/user1/remote-repo.git and then continue with steps 11 - 13.
@SerbanConstantin: not sure. I think at point 10 he will have no remote at all (git remote -v will print nothing), thus trying to set the url directly will probably fail with fatal: No such remote 'origin'. Not so sure anyway, I tend to remember the minor amount of information needed and in this case GitHub is my friend: if you create an empty remote repository there, it gives you exact commands to create and push a local one!
my comment was assuming that he won't be deleting the already-made repository (git_ball in the OP).
ah that makes sense! I didn't understand, sorry!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.