简体   繁体   中英

Errors cloning a git repo

I am new to Git and for a class assignment I need to clone a repo set up by the instructor as a first step of about 50 this week. His instructions are to:

mkdir -p ${HOME}/cpsc59700
cd ${HOME}/cpsc59700
git clone git@github.com: lewisu-research-compsci/assign0-git tu2
cd tu2
TUTROOT=${PWD}

He says "the first argument specifies the remote repositoy in GitHub you would like to clone and the second argument specifies the name to give to the new local repository." I am guessing "lewisu-research-compsci/assign0-git" is the remote repo while "tu2" is the local repo.

Each time I try to run the git clone command I am met with the following error:

fatal: Too many arguments

If I leave off the tu2 argument I get the following error:

Cloning into 'lewisu-research-compsci/assign0-git'...
Enter passphrase for key '/c/user/Brian/.ssh/id_rsa':

When I enter the passphrase that I used for creating the ssh key I get the following error:

ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I have access to the repo when I log in to Github.com. Also, when I try using Git Desktop, I can clone the repo which is what confuses me. I have emailed the teacher as it is an online class but so far (3 days later), I have not heard back from him. Any suggestions on what I am doing wrong?

Try removing the space after the domain name, like this:

git clone git@github.com:lewisu-research-compsci/assign0-git tu2

The space causes lewisu-research-compsci/assign0-git to be your second argument and tu2 the third one, that's way the error says "too many arguments".

Hope you are able to make directory and go inside it. Then follow following step

1) Go to following link.

https://github.com/lewisu-research-compsci/assign0-git

在此处输入图片说明

2) Click on copy to clip board button. 3) Open your terminal and navigate to your directory where your want to get the clone.

4) Then type git clone https://github.com/lewisu-research-compsci/assign0-git.git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM