Reputation: 676
I am using EGit in Eclipse. I have one local repository with a Working directory and two branches. I have create a branch based on the master branch. I have added a folder and a file in the folder in the "secondary" branch. When i switch to the master branch, the folder i have created in the other branch and the files are showing up in the master branch and in the working directory.
Did i miss something? According to me it shouldnt show up and only when i push the secondary branch to the master one.
Could you please help on that
Regards
Upvotes: 0
Views: 33
Reputation: 20885
Creating something in the filesystem (for example with mkdir
or touch
) doesn't mean anything in Git. Once you commit the changeset, a new Commit object is created, and HEAD
points to that commit on the current branch (possibly different from the default one, master
). As long as you don't commit anything, your filesystem objects (file and directories) are not tracked by Git; instead, they effectively float around, so when you git checkout SOMETHING
you end up with the new (untracked) objects or maybe an error message.
Upvotes: 1