It wasn't a problem since I can revert in branch xxx with "gt reset --hard HEAD"
I just wonder why deleting behavior at one branch can affect the other branch? Doesn't the branch stored everything?
- then I tried to merge one of my branch using "git merge xxx", it said "alread update to date"
This happen because your xxx branch was already merged into master and nothing changed in xxx after that.
- I checkouted to branch xxx, during the branch switching, it shows a long list that every file had a status 'D'
You haven't commit changes and switched to a branch xxx, so all your changes moved to this branch
I just wonder why deleting behavior at one branch can affect the other branch? Doesn't the branch stored everything?
Yes it does. But you moving your changes between branches without commiting so you could see it in every "up-to-date" branch. Just commit it somewhere and it will behave as expect
Edit: Deletion of files is the same operation as modifying for git, so you have to commit changes after delete, somewhere between steps 5 and 6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With