Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in DevOps and Agile by (29.3k points)

I'd like to git clone the contents of a repository I have on GitHub. When I git clone ([email protected]:me/name.git...) I get a folder called name/ and inside name I have my contents... How do I get JUST the contents?

2 Answers

0 votes
by (220 points)
git clone <repository> .
0 votes
by (50.2k points)

If the current directory is empty, you can do that with:

git clone [email protected]github:me/name.git .

(Note: '.' at the end is used to specify the current directory.)  this also creates the .git directory in your current folder.

From documentation:

“It points out that cloning into an existing directory is only allowed if that directory is empty.”

Browse Categories

...