gitgit-branchgit-extensionsgit-repo

.Git inside git repo and branch are not showing


I'm running into trouble with my git repo. I had a bunch of branch that I realize are missing and I came to this conclusion. My file structure looks like this

REPO-A  
  -/hooks  
  -/info  
  -/objects  
  -/ref  
  -config  
  -description  
  -HEAD  
  -packed-ref  
  -/.git  
    --/hooks  
    --/info  
    --/log  
    --/objects  
    --/ref  
    --COMMITMESSAGE  
    --config  
    --description  
    --FETCH_HEAD  
    --HEAD

When I clone my repo I only see some of my branches that I had and I only have one submodule. If however I delete the /.git file and everything contained under it, I get all my branches back but the ones that I see when the /.git file there are out of date. I was wondering what has happened and how to undo it? I've searched all the reflogs of everyone who’s pushes to the repo but they seem to be all pushes, so I'm a little lost. Any help would be appreciated!


Solution

  • git commands will determine where the git repo is in the following way :

    So :

    You can run git rev-parse --show-toplevel to view what git chose as the base directory of your repo.


    If you want to update the branches in that repo, use git fetch and git pull.