Do not create folder when cloning Gitlab project

Asked

Viewed 365 times

1

I have with my partners a repository in Gitlab. The repository already shows by default, the folder api and too txts, that is, I don’t have a folder inside the repository, where, by opening it, I have access to the files that are changed.

But when I do git clone in the repository, it always creates a folder (with the project name) and plays the change files inside. Does anyone know if they have any commands or anything like that where they don’t create this folder by default?

  • Just a question, are you talking about the first 'git clone' or new environment? or are you performing a git clone inside an already cloned git? example, "'first' git clone Repo.git cd Repo" "'second git clone within Repo' git clone Repo.git cd Repo 'see the newest changes" if it is, git clone is only done once per environment, from this it’s only "git fetch/git remote Prune/git pull" if I got it wrong, let it pass

2 answers

5


You can make git clone with a . in the end, the . replaces the default path from where the project will be created.

git clone url-projeto .

3

The git clone command takes 2 parameters: the repository address and the path to the clone. This 2nd parameter is optional and, if omitted, a directory with the same name as the repository is created.

Ex: $ git clone https://github.com/libgit2/libgit2 mylibgit

Documentation: https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository

Browser other questions tagged

You are not signed in. Login or sign up in order to post.