Reputation: 3773
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?
Upvotes: 4
Views: 3614
Reputation: 316
- 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
Upvotes: 3
Reputation: 63
For better understanding of git branches if you use Windows try use application "Git Extensions". This app shows all branches in your repo and it is do understanding simpler.
Upvotes: 1