Yes, I believe that should behave as you expect.
Git repository start over
I've got a project which I've been working on for a while, with the repository being on Github, build in a different framework. But now I'm working with Laravel, I have started over with the project. I just created a new Laravel project in a different directory, starting from scratch again. This new project is not in git/github yet.
So now I want to "replace" the Github repository (with the old code) with my new code. I could completely delete the Github project, create a new one and start over. But it would be nice if I could use the same Github repo and "push" my new local code into that one, completely replacing the old code. So then I'd still be able to see the old code and all of its commits.
Have been searching for a while, but most threads I find talk about merging branches. I don't have a local branch.
My guess is it's something like this:
cd my/local/dir/with/project
git init
git add --all
git commit -m "first commit with new code base"
git remote add origin https://github.com/myname/myproject.git
git push --force origin master
But I'm not sure about it. Will that last line do exactly what I want?
Please or to participate in this conversation.