3

I use the svn git supported by the Cygwin packages[i.e. setup.exe ].

I tried to create a second local branch on the local repo, and add a new file on the second branch. This new file should be only in the second branch since I haven't merge this branch to the master branch.

however after I checkout to the master branch, the file is there!!?? Any Ideas? Any help will be appreciate~~

my steps are:

git br haha
git co haha
touch a.txt
git add a.txt
git ci a.txt
git co master 

[I see a.txt is there...]

werkritter
  • 1,479
  • 10
  • 12
Anakin Tung
  • 419
  • 5
  • 17

1 Answers1

0

Whenever switching from branches the local files modifies with the checkout. To avoid, add and commit the locally created file to the specific branch and then switch.

Digambar Patil
  • 128
  • 2
  • 3
  • yeah... indeed this is my fault, I don't do the add and commit on the haha branch, so that the file hasn't been tracked by Git. Thanks Nitin~~ – Anakin Tung Jul 21 '15 at 07:04