Untracked files between branches in Git

前端 未结 3 491
日久生厌
日久生厌 2021-01-30 11:03

I\'ve been searching around here for to look for an answer and it seems I may just be making incorrect assumptions on how git branches are supposed to work.

I have my

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 11:49

    They're not showing up in the master branch - if you did a hard reset and a clean, they'd disappear. Git is merely preserving your local modifications when you switch branches.

    This is commonly useful; you might have realized you want to commit those modifications to a different branch than the one you're currently on. If the modifications conflicted with the difference between the two branches, git would refuse to switch branches.

    You're right about the best approach, though - switching branches cleanly is in my experience one of the most common uses of git stash.

提交回复
热议问题