I have a real mess on my hands. I have a private GitHub repo that I own and am the sole contributor/maintainer of. So whatever hackery is required to solve my problem will only affect me and no one else.
Here's my situation:
- My GH repo is, say,
https://github.com/mygithubuser.example.com/myapp.git
. I have a local clone ofmyapp
at, say,~/sandbox/workspace/myapp
. - I deleted
~/sandbox/workspace/myapp/.git
(effectively disconnecting it from git/GitHub) and renamed it to~/sandbox/workspace/myapp-old
. - I created a new barebones app project locally at
~/sandbox/workspace/myapp
. - Inside that new
myapp
dir, I did: (a)git init
, (b)git add .
, (c)git commit -m "Starting over again."
. - I now want to somehow connect the new local
myapp
repo to my GitHub repo athttps://github.com/mygithubuser.example.com/myapp.git
, and completely blow out anything that is in that remote repo with everything that is in the new localmyapp
repo.
So again, I want to force GH to allow a push from my new myapp
repo to override everything that is in my remote GH repo.
We have to pretend that myapp-old
, although it exist locally on my machine, cannot be part of any solution. We have to pretend like it no longer exists.
I found this answer but it's not working for me. What can I do? What are the exact Git command-line invocations I can run to accomplish what I'm looking for?
Please note there is a specific reason for why I need to do exactly what I'm asking for here. To explain why would require me to launch into a very long backstory that would be dry, boring, and would make this question a strong candidate for downvoting/closevoting. So please don't ask me "Why are you doing this?"- or "Why don't you just X"! I promise you there is a good reason for it.