I'm learning how to use Git now, after a long life with SVN. I am not understanding how to use branches because in SVN a branch is a copy of trunk with all files.
With this, if I make a branch to fix a problem I can see the application running on trunk all the time. Just point the browser to the correct folder. If I want to see the result of the settings I'm doing in branch just do the same thing, I point to the branch folder.
In Git, after creating a branch and editing a file, I "lose" the view of the previous state of the application.
The example described below has been taken from "git-scm.com":
- I create a branch for an error (
iss91
), work on it a little - I create a second branch to test a new way to solve the same problem (
iss91v2
) - I go back to my master and work on it for a while
- I create a new branch to work on something I do not know if it's a good idea (
dumbidea
)
What I do not understand is: "when I go back to my master and work on it for a while" I no longer see how my master
worked when I created the first branch ( iss91
)? When I run my application at that time, it runs with the settings made in the iss91v2
branch.
How should I use this? How does this workflow work?
UPDATE: The question is how to visualize different implementations to solve a problem in different branches since, after editing the branch iss91v2
, if I give a git checkout qualquer_outro_branch
and running the application I will not see the result of the implementations of that branch . I will only see the system with the settings made in the iss91v2
branch.