1

I can't find remote branches on the subfolder of my cloned repository.

Context : I'm building a website using Ruby on Rails. So, I have the default blog folder (containing files generated by Ruby on Rails) inside folders which act as dividers (for example to separate backend and frontend). I cloned the project folder (root) and created a new branch there. The structure of the folders is project/code/backend/blog.

The codes that I used ...

  1. git clone https://github.com/username/project
  2. cd project
  3. git branch features
  4. git branch -av => showed the existence of the features branch.
  5. cd code/backend/blog
  6. git branch -av => showed nothing.
Taylor
  • 11
  • 1
  • 2
  • What repo? Is the folder a submodule? – jonrsharpe Dec 30 '19 at 19:34
  • No, I only cloned the project folder which consists code/backend/blog. As far as I know, a submodule is a repository is it? Btw, thanks for your prompt reply! – Taylor Dec 30 '19 at 19:36
  • 1
    But that clone might include a submobule: https://git-scm.com/book/en/v2/Git-Tools-Submodules. Please give a [mcve]. – jonrsharpe Dec 30 '19 at 19:37
  • @jonrsharpe umm, sorry I don't quite understand. But the context is I'm building a website using Ruby on Rails. So, I have the default blog (containing files generated by Ruby on Rails) folder inside folders which act as dividers (for example to separate backend and frontend). I cloned the project folder (root) and created a new branch there. Thanks! – Taylor Dec 30 '19 at 19:45
  • We can't help without more information. – jonrsharpe Dec 30 '19 at 19:46
  • @jonrsharpe Do you mean I should check if my project includes a submodule first? Sorry, I'm very new at git! – Taylor Dec 30 '19 at 19:50

1 Answers1

0

As described in comments, it is likely that code/backend/blog may be a git submodule. To verify that, run:

 git config --file .gitmodules --get-regexp path | awk '{ print $2 }'

in project's root directory.

If code/backend/blog (or one of its subdirectories) is on the list of values returned by this command, then it is a submodule (or is a part of a submodule), and therefore it has separate branches.

More on listing submodules here: https://stackoverflow.com/a/12641787/11116436