Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+20 votes

I did the following command on gitBash yesterday 1)cd /h/git and 2)git clone
and I imported the existing project into eclipse
but I still wasn’t able to add and commit, I think it was giving me an error message ‘’No such file or directory’’ anyone knows why ?

asked in CSC305 Fall 2022 by (1 point)

6 Answers

+8 votes

Make sure after cloning the repo, you change your directory to the repo you just cloned. That means running another cd command looking like:

cd /h/git/RepoName

Replacing "RepoName" with the name of the local repo. I hope this helps!

answered by (1 point)
+7 votes

After you clone the repository you still have to do the command “cd “ and then the repository name so that you are in the actual repository. Then after that you can push and pull

answered by (1 point)
+5 votes

It might be that the folder/file you're trying to work with in git bash no longer exists or never did. Is it possible there was a typo in either your command or the folder/file names? Did you or anyone in your group recently move/delete folders/files involved in your project?

answered by (1 point)
+4 votes

You have to select a specific folder within your git folder, like cd /h/git/project1 I believe

answered by (3.3k points)
+4 votes

It is probably because you are not in the repository. When this happens I usually write 'ls'. This gives a list of sub folders. I then choose my repository by typing 'cd /h/git/reponame''.

answered by (1 point)
+3 votes

You are attempting to push the folder, not the repository. You need to cd (change directory) to the folder and push the repository

answered by (2.1k points)