Quantcast
Channel: User Schwern - Stack Overflow
Viewing all articles
Browse latest Browse all 581

Comment by Schwern on should git checkout work when the index is dirty?

$
0
0
@SteveSummit The rule of thumb is Git will strive to not lose your work. Consider if it worked as you described. You're in the middle of resolving that big merge conflict, go to lunch, and when you come back your boss assigns you a new task. You thoughtlessly type git checkout main and poof all your work on the merge conflict is gone. On the flip side, if git checkout can switch to another commit and still preserve your uncommitted changes it will do so. This is handy to move uncommitted changes between branches without having to stash and unstash them.

Viewing all articles
Browse latest Browse all 581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>