Git new file appears in all branches

半世苍凉 提交于 2019-12-05 13:23:06

Git will never touch any files that aren't actually in your repository. (untracked files)

You need to git add and git commit the file (into one branch) first.

This is where is is important to understand the index (or staging area).
As long as you don't stage (git add) files, they remain "untracked" (or "private"), and won't be modified by a "git checkout".

That is different from "unstaged" which references tracked file (previously committed in the local Git repo) with local modifications not yet added to the index.

You can read more in "You could have invented git (and maybe you already have!)"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!