3

I am trying to add multiple projects into a single repository in Bitbucket, but after commiting when I pushed to the origin master it just added the empty folders. No subfolders and files have been added. I have followed below steps,

  1. From the main folder, git init
  2. git remote add origin gitrepository name
  3. git add --all
  4. git commit -m "initial commit"
  5. git push -u origin master
Chris Martin
  • 30,334
  • 10
  • 78
  • 137
musreg
  • 33
  • 1
  • 6

1 Answers1

3

That would happen if those project folders are themselves nested git repos.

In that case, the content of those nested repos would be ignored: see "How to commit a git repo into a git repo (not submodule)".

You could try and "merge nested git repo into parent repo, retaining history".

Or you could declare those nested repo as submodule.
(as in "Creating Git Submodules out of existing repository and reflecting parent changes to the child repository")

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250