Reputation:
I am collaborating with my teammates on a Project in which one of my teammate has uploaded our project on GitHub.
I want to clone the repository into my VS Code.
Here are the steps I have performed:
git clone <URL>
in which the URL is the URL that I have just copied.git status
, the output is fatal: not a git repository (or any of the parent directories): .git
as you can see at the bottom of the screenshot.May I know did I do any mistakes? What are the correct steps to rectify the issues displayed by the Terminal? Thank you.
Upvotes: 4
Views: 18779
Reputation: 1
Just check are you in correct directory where you have cloned project. Then run below command to pull code
git pull -r
if this is not working check in your current directory has .git file. If it's not there it's not a git directory you have check and clone again.
And also try go into next directory from current directory and run the same command.
git pull -r
It may be a git directory but you tried out side of that parent directory.
Upvotes: 0
Reputation: 1324228
I have tried running cd student-course-registration-system and when I run git status again, my Terminal shows this result:
As mentioned in the screenshot, use git restore
:
git restore --staged --worktree -- .
That will restore all files from HEAd commit to your working tree and index.
Upvotes: 0
Reputation: 21
You need to be present in the active directory in which the git repository was cloned.
cd into the downloaded directory then VS Code will automatically get updated with the current repo.
Try using extensions like Git lens and other git-related extensions that make this process easier.
Upvotes: 2