0
I’m learning to use Git now, after long experience with SVN. I don’t understand how to use the branches For in the SVN one branch is a copy of trunk with all the files.
With that, in case I make one branch to fix a problem I can view the application running on trunk all the time. Just point the browser to the correct folder. In case I want to see the result of the adjustments I am making to branch just do the same thing, point to the folder branch.
In Git, after creating a branch and editing a file, I "lose" the view of the application’s previous state.
The example described below was taken from "git-scm.com" :
- cryo-um branch to a mistake (
iss91
), work on it a little bit - create a second branch to test a new way to solve the same problem (
iss91v2
) - go back to mine master and work on it for a while
- create a new branch to work on something I’m not sure is a good idea (
dumbidea
)
What I don’t understand is : "when I return to my master and work on it for a while" master
worked when I created the first branch (iss91
)? When running my application at that moment it runs with the adjustments made in the branch iss91v2
.
How should I use this? How does this workflow work ?
UPDATE: Doubt is how to visualize different implementations to solve a problem in different branches once, after editing the branch iss91v2
, if I give a git checkout qualquer_outro_branch
and run the application I will not view the result of the implementations of that branch. I will only see the system with the adjustments made in the branch iss91v2
.
See if it helps you: http://answall.com/q/80583/101,
– Maniero
Possibly answered in What is the difference between a branch and a tag?
– Bacco
Unfortunately it did not help. This information I understood. I think the question ends up being : after I make a branch I no longer have access to the previous version unless I give a "reset" to disappear the commits I made in the branch ? Type : the project address is the same, but from the moment I create and modify a branch, when entering the address I just visualize the project with branch modifications. If I want to visualize what the project was doing before it’s not possible, because it now shows the adjustments I made to the branch. I didn’t understand how to use the toggle between one branch and another.
– Joseka
Related: How branches work in GIT in relation to SVN?
– Jéf Bueno