简体   繁体   中英

Completely overriding Github branch with the Master branch

So I am working on a project for school using GitHub. What I am trying to do is basically wipe my branch, or completely override it so it is identical to the current master Branch

I have done some research on how to do this but I am unsure what the best way to do this is. I'm basically brand new to Github so I just want to make sure I don't screw anything up for my group.

Any help would be much appreciated!

I can suggest two options for you.

Just delete entire directory and clone the code from GitHub again, as if it is your first time.

But, if I were you, I commit my changes into my branch with git add . and git commit -m "Tried so and so, but will put this off for a while and come back later." commands. You never know when you would need that brand new function you have created.

Once all your changes are safe, just do git checkout master and you will be back on master branch. However, before changing any code, please do a git pull to get all latest code from GitHub master.

Happy coding!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM