I am behind of master of one commit. I know the commit only affects file A. I have a local change of file B. Even B will not be changed, git still won't pull but let me do stash or discard local changes. Is there any way to pull from master without committing or stashing or resetting file B.
Now I have to stash it and pop it back. I am not sure but I remember years ago I can just pull head with irrelevant local changes. Did I miss some settings?
git pullwould sometimes work even with uncommitted changes. However, in ancient versions of Git,git pullwould sometimes destroy uncommitted work. It's a tradeoff, you can have a 100% working Git that doesn't let you do this, or a buggy ancient Git that does but loses your files. :-)git stash: it's overly fragile. If the rebase goes wrong, the stash doesn't get auto-unstashed (in at least some versions of Git, maybe all, I have not checked lately). The new autostash-with-merge also works, but I'd expect the same caveat (if the merge stops, you have to finish it manually, after which I imagine you have to unstash manually too).