Reputation: 189
I have configured one repository in GitHub "MyRepository"`
In this repository, i have one branch "master"
and in this branch i have one project "Test"
In eclipse i created one local repository, the structured of this repository is as follows.
> GitRepo
--> Branches
-> Local
---> master
--> Remote Tracking
-> origin/master
--> tags
--> References
--> Remotes
--> origin
--> [email protected]:testusr/myRepository.git
--> working directory
--> Test
Now suppose i have to work on one defect, so i created on local branch from remote "master" branch like
> GitRepo
--> Branches
-> Local
--> defect123
--> master
I switched to branch "defect123" and suppose i working on one file "myFile". Problem occurs over here is that what ever changes i am making in "myFile" in "defect123" branch, it is also reflecting in the "myFile" in "master" branch on the same time.
Why its happening. Thanks in advance
Upvotes: 0
Views: 383
Reputation: 1536
What do you mean with "it is reflecting in 'master' branch on the same time"?
If you do a checkout of "master" and have uncommited changes in "defect123" this changes will be merged into the "new" checked out working set.
If you commit this changes in "defect123" or stach the changes before checking out "master" you will get a "clean" "master".
Upvotes: 1