Skip to content

newbie question #22878

Answered by dtashley
ravi567 asked this question in New to GitHub
Discussion options

You must be logged in to vote

If I’m understanding your description correctly, the issue was likely that test_file was untracked, so git let it hang around in your sandbox while you switched branches.

I have not verified this behavior, but it makes sense if this is the case.

When you switch branches in your git, git’s only rule is not to destroy information.  This means that if a tracked file has been modified, it should refuse to do the switch.  However, if a tracked file has not been modified, it is free to bring a different revision into your sandbox or to delete it from your sandbox (the rationale for this is that you can get the file and its contents back by switching back to the original branch).

But with an unt…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants