Reputation: 2400
I created a git repository a while ago, and now I realize that I don't need many of the files in the original project. I looked at this site but it seems to me that using git filter-branch
is not the right tool, also because I have to delete many files and it doesn't make sense to use the command outlined there for files and directories. I guess what I would like to do is to have the repository in my computer be the new remote repository. So is there a way to replace the remote repository entirely by the one in my computer?
Upvotes: 2
Views: 305
Reputation: 76887
You will need to run a git push --force origin master
from your new local repo.
This will force update all the refs for master branch to those of your local repo. Note that this will not update any other branch, and will affect master only.
In case you want to delete all the other branches from the old repo as well, you can
git push origin :branch_name
Upvotes: 1