Search code examples
github-pages

Not seeing any of my website code in the repo - ghpages react


A while ago I created my github pages website with react app. I can still access it fine when I go to the url - it shows it up to date with whatever styling or things I added. but when I clone the repo to my computer and try see what files/code there is, I'm not seeing any of the typescript code related to the website. There are a few commits but they were from when I first created the app. Like there is the App.tsx file but in that is just the bare bones of whats usually given when you create the react app

As it's been a while since I made it I'm not sure if I have forgotten to do something. Is it something to do with the two branches, master and gh-pages?


Solution

  • It's possible that the TypeScript files are stored in a different branch than the one you are currently cloning. When you clone a repository, you only clone the current branch by default.

    What you can do is:

    1. git clone --recursive <repository URL> to clone all the branches
    2. Use git branch to list all the branches.
    3. Switch branch using the git checkout command.
    4. Lookup and the file should in one of the branch.