Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git clone with external linked repositories in branch?

Tags:

git

clone

I trying git clone this case.

For example in git branch:

  • external repo 1 @ 797131b
  • external repo 2 @ 04a1ffe
  • external repo 3 @ b8132df

It is external linked repositories in branch.

I want git clone repository with external linked repositories.

But, I can only check empty directory after git clone.

How to clone git repository with external linked repositories in once try?

like image 542
Go Namhyeon Avatar asked Jul 19 '16 15:07

Go Namhyeon


People also ask

How do I clone a git repository from a branch?

There are two ways to clone a specific branch. You can either: Clone the repository, fetch all branches, and checkout to a specific branch immediately. Clone the repository and fetch only a single branch.

How do I clone a remote repository branch?

In order to clone a specific branch, you have to execute “git branch” with the “-b” and specify the branch you want to clone. $ git clone -b dev https://github.com/username/project.git Cloning into 'project'... remote: Enumerating objects: 813, done.

How do I clone a repository to another GitHub?

Navigate to the repository you just cloned. Pull in the repository's Git Large File Storage objects. Mirror-push to the new repository. Push the repository's Git Large File Storage objects to your mirror.


1 Answers

To automatically initialize and update each submodule in the repository, pass --recursive to the git clone:

git clone --recursive <repoAddress>

More about submodules: https://git-scm.com/book/en/v2/Git-Tools-Submodules

like image 56
dNitro Avatar answered Sep 23 '22 10:09

dNitro