Momo p. Momo p. - 1 year ago 83
Git Question

How to move branch files to another branch?

I have some files and directories in the master branch, and I've created another branch named 'dev'.

I would like to know the trick to move all the master content to the 'dev' branch, without committing to the dev branch and delete all master content.

Answer Source

To get a new branch with the same content as master, do a git checkout -b new_branch from the master. Then do a git checkout master and manually delete all the files..

Hope this helps!!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download