0

I'm new to git-flow but have worked in other version control systems (notably perforce) and used branching strategies very similar to git-flow. I'm not very familiar with the git CLI, so I use SmartGit and of late SourceTree.

I've set up git-flow on a client machine (remote/origin is a bare repo on a server) and I now see that there are two branches on my client - develop and master. But SourceTree never asked me for a working directory for the develop. From what I see it is dynamically switching branches (fetching from appropriate remote branch).

My question - Is this the right way of working with git? I mean what if I am working in a feature/* branch and need to work in a hotfix/* branch. My changes to the feature/* branch would get lost if I did not stash them before the switch.

In a past life the way we handled branches was to have a different root/working folders for each branch and work on them in isolation without affecting work in any other branch.

Can I do the same with git i.e. clone each branch at a different working folder. More importantly would this scheme work with git-flow as implemented in SourceTree/SmartGit?

Code Poet
  • 11,227
  • 19
  • 64
  • 97
  • What is the problem with stashing the branches if you have to do a quick change in another branch? – Pigueiras Sep 22 '13 at 20:01
  • @Pigueiras it a problem if I want to work simultaneously on two or more branches. It is not uncommon for me to have two instances of eclipse/visual studio open simultaneously with source from both the develop and the dot fix branch. – Code Poet Sep 23 '13 at 09:22
  • http://stackoverflow.com/questions/2048470/git-working-on-two-branches-simultaneously ? – Pigueiras Sep 23 '13 at 09:33
  • @Pigueiras Thanks! That's what I was looking for. Please put this as an answer so I can accept it. – Code Poet Sep 24 '13 at 07:16
  • This is a duplicated question then, maybe you can flag your own question as a duplicate :). It's not a good thing to put an answer with just a link to another SO answer haha. – Pigueiras Sep 24 '13 at 07:23

0 Answers0