I have two branches say master and dev.
Master is old and I want to put dev into master so effectively:
- Delete all files in master,
- Copy all files from dev into master
- so at that time, master and dev became the same, without merging dev into master.
I can do this in the following way:
- Checout dev branch.
- Make a copy of dev branch some where on my hard disk.
- delete .git from the copy of dev branch on my hard disk.
- checkout master branch
- Delete all files other than .git in working dir.
- Copy all files from dev into working dir (all files are the same as dev branch other than what is in .git directory, but it is in master brach now)
- Commit master branch.
But I am wondering what is the correct way to do this in git?