B
B
BonBon Slick2017-10-27 16:41:49
git
BonBon Slick, 2017-10-27 16:41:49

By force to move to another branch without commits?

There is a master branch and a dev branch. Subdomain created, sudo cp -R mainDomainFolder testDomainFolder.
Now, when you try to switch to the dev branch from testDomainFolder, it gives an error that you need to do a stash or a commit, but you don’t need to do any of this, I want to do a hard reset. Take it, go to the dev branch in the testDomainFolder folder, and download all the files new from the dev branch.
How to switch to a new branch and take all the files from there without commits and other things?
If the files in the folder are lost, it's okay.
Of course, you can clone the dev branch over a new one into a clean folder.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2017-10-27
@BonBonSlick

Why doesn't hard reset work? especially

If the files in the folder are lost, it's okay.

you can just clone from scratch I'm sorry, I read the question inattentively, hardreset can do this:
cd testDomainFolder
git reset --hard

A
Andrey Andreev, 2017-10-27
@b0nn1e

I want to do a hard reset

And what exactly is stopping you?

S
Sergey Andreev, 2017-11-14
@DragorWW

git fetch --all
git checkout -f master # если нам надо в мастере

#так же можно сбросить локальное состояние
git checkout -- ./

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question