Git branch switching does not change code folder files

前端 未结 1 1369
[愿得一人]
[愿得一人] 2021-02-20 05:24

This is a follow up to this question.

I cloned the remote master project folder using git clone git@git.mytest.com:TEST command. from the Git root, I did a

相关标签:
1条回答
  • 2021-02-20 05:52

    No it's not part of your master branch, but it's not part of myBranch either. It is untracked, because you never committed the file. Running git status you'll see it listed as untracked. Since it was never staged or committed, Git doesn't (and can't) manage its existence, so it stays there regardless.

    Further, modified files remain between branches if they can. Else Git will give you an error when switching branches about a dirty working tree. This is, again, because Git has no internal copy of those changes, they exist only in your filesystem, and not within Git till they are committed.

    0 讨论(0)
提交回复
热议问题