0

I'm new to Git. I don't remember exactly what I did a few days ago, but this is what used to be:

In my WSL Ubuntu I had these folders, some which were also repos on GitHub:

BytePhase1/
flask_tutorial/
acrainier1.github.io/
jpnProject/
lectureReactJS/
api_calls/
reactJS/
replicants/
terminalTraderRepo/

MORE IMPORTANTLY, inside acrainier1.github.io, there WAS ONLY readme.md, index.html and index.css.

Then I did some git remote voodoo magic and my entire Ubuntu directory is now INSIDE acrainier1.github.io, INCLUDING acrainier1.github.io (HERE: https://github.com/acrainier1/acrainier1.github.io )

However the second layer of acrainier1.github.io is empty when I cd into it.
And, I cannot find the readme/html/css files.

If you go to acrainier1.github.io on browser, my index.html resume still renders....lolz what?

How can I undo what I don't even know what I did?
I remember making some repos and trying to clone them.
In the end I deleted them. GitHub is hella confusing.

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

2 Answers2

1

This is not linked to GitHub itself, but to your local Git repository: check if you have a .git folder in your homedir, above your normal local folder acrainier1.github.io.

That would explain why a git add;git commit;git push did push all those folders instead of only the one you want.

Ideally, you would:

  • delete that .git (if there is no history in it)
  • recreate it in your folder acrainier1.github.io.

That is:

cd acrainier1.github.io.
git init .
git remote add origin https://github.com/acrainier1/acrainier1.github.io

To keep the remote history:

git fetch
git branch master origin/master 
git reset

But to override the remote GitHub content, it is best to restart everything:

git add .
git commit -m "first commit"
git push --force -u origin master

The OP Alex Canizales did (as mentioned in the comments)

  1. rm -rf .git from homedir,
  2. deleted original master branch in acrainer1.github.io, and
  3. renamed new-branch to master,
  4. pushed/pulled/fetched to sync local & remote
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

On first glance, it looks as though you put your home directory under version control with git and pushed it up to: https://github.com/acrainier1/acrainier1.github.io

The FIRST thing I would do is go to Settings on the remote repo ( using the browser ) on GitHub and make the repository private. You can change it by scrolling down to "Danger Zone" and you will see the option to change it.

[Make Repo Private on GitHub][1]: https://i.stack.imgur.com/j72Ou.png

Then sort out the problem after that is done.

You probably do not want to share these files with the world.

jwDavis
  • 63
  • 2
  • 6