[OT] Question about Git branches

Frank Millman frank at chagford.com
Wed Sep 17 11:52:40 EDT 2014


"Sergey Organov" <sorganov at gmail.com> wrote in message 
news:lvbtd2$fsg$1 at speranza.aioe.org...
> "Frank Millman" <frank at chagford.com> writes:
>> Hi all
>>
[snip lots of really valuable information]
>

Thanks a stack, Sergey, that is a really useful explanation.

For the record, this is where my initial confusion came from.

The following quote comes from the book Pro Git, by Scott Chacon. It is 
typical of the advice found in other tutorials and notes I have read.

"""
Let's go through a simple example of branching and merging with a workflow 
that you might use in the real world. You'll follow these steps:
1. Do work on a web site.
2. Create a branch for a new story you're working on.
3. Do some work in that branch.
At this stage, you'll receive a call that another issue is critical and you 
need a hotfix. You'll do the following:
1. Revert back to your production branch.
2. Create a branch to add the hotfix.
3. After it's tested, merge the hotfix branch, and push to production.
4. Switch back to your original story and continue working.
"""

Nowhere does it state that you must commit or stash your current changes 
before switching branches. Maybe it is implied by 'revert', but as a newbie 
I had missed that.

With your help and input from others, I have a much better understanding 
now.

Frank






More information about the Python-list mailing list