Need help grabbing project from GitHub

Hi, so I have been able to put my Node/JavaScript Project (developed on my local machine) into GitHub, but I have been having trouble cloning the files from a branch of the repository into my glitch project.

Problem:
I am able to type this into the glitch terminal:
“git clone https//github.com/Andrew-Gallimore/new-project.git test”,
“cd test” and,
“git checkout v2.3” which puts the branch I want of the repository into a folder called “test”.
But I am not wanting the files of the project in a folder (in this case it is named ‘test’), I want them put in the main directory, the directory where the folder “test” currently is.

Attempts Made:
In the past I have been able to say “.” rather than “test” in the first command, and it would put the files in the main directory all fine. But since then, that simply returns an error saying:
“fatal: destination path ‘.’ already exists and is not an empty directory.”

I have tried ‘rm’ (clearing the “.” directory before trying) and also ‘mv’ (moving the files from test to “.”) But I am not able to get anywhere with anything like that.

Links to projects:
Here is links to the 2 projects that relate to this:
(the current one needing help with)

(the past one where I was able to use “.” rather than a new folder)

Note: I am trying to get the files to end up being laid out roughly like how I did in the first project.

I am sure that there is a simple solution because I somehow did it before. :slight_smile: Any help I can get is great. I am new to this (posting my question this way) so tell me if you need any more information about it to figure out how to do it.
Andrew G.

1 Like

destination path ‘.’ already exists and is not an empty directory is probably true. The Glitch project container uses the /app directory as a home directory, so there are a lot of dotfiles that you wouldn’t see with ls and wouldn’t erase with rm -r *. Check ls -a to see them, and remove them as well.

You can alternatively break git clone down into git remote add origin https://github.com/... and git fetch etc., which work when . is already initialized as a git repo.

2 Likes

Hey, thank you so much wh0, that solution worked a treat (of adding the origin and fetching it). And nice job explaining it!

See it was a simple solution, I was just going about it weirdly. :smiley:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.