I’ve got a problem with one of my git repositories (FYI: I’m really new to git)
Basically I forgot about the repo I’d created for a project, worked on the wrong set of files (my original copies), made some BIG changes and renamed most of the files.
Now I’ve realised my mistake I was wondering how I can put the new files in to my repo, replacing the old files so that I don’t end up with 2 different versions of the same files under 2 different names.
I didn’t want to have to completely delete the old repo and re-create it again with the new files because I’ve already pushed it up to github.
Anyone able to offer some help and/or advice please?
nb: wasn’t sure of the best ‘Stack’ site to put this on, figured here or programming?!
So you have a repository R and a different working directory W, on which you have worked without having any version control, right?
Basically, after you made sure there are no uncommited changes in R, you replace the checkout of R with the content of W: Delete the content of R, except for the .git directory and any .git* files, and copy the content of W into it, so that the files that stayed the same are on their old places.
Then you create a new commit and push it up to github.