branching and merging - Best way to manage local feature branches with git? -


i looking @ of finer points of branch management git , basing few of decisions around article:

http://nvie.com/posts/a-successful-git-branching-model/

now have simpler scenario here, remotely on origin have master , development_branch. far developers concerned development_branch main place clone from, , merge development master when have stable release.

now in mind have bunch of stories each sprint need through, clone development_branch make new branch story/feature working on, such product_description_feature. local branch worked upon if need pick task or fix of sort have clean development_branch return , branch from.

now question comes around process work way, safe option seems following process:

  • clone development_branch
  • create new branch task (we call feature_a in example)
  • commit feature_a branch until task complete
  • switch local development_branch
  • pull new changes origin down (usually frequent thing anyway)
  • merge changes feature_a development_branch
  • push development_branch local origin
  • create new branch next task

now works fine, happy, take following scenario want pull more regularly:

  • clone development_branch
  • create new branch task (we call feature_b in example)
  • commit feature_b branch
  • you realize blocker , have pull latest changes
  • switch development_branch
  • pull development_branch origin local
  • switch feature_b
  • merge development_branch local feature_b
  • continue working until done

now seems safe , happy, not sure if need switch development_branch , pull down switch , merge local feature branch. being overly cautious here , should pull development_branch origin local feature_b branch?

this seems should fine i'm doing taking changes directly local feature branch without updating local development_branch, if need push changes again switch, pull, merge, push.

so can confirm if practice or not etc?

also without polluting question much, these feature branches exist on each developers machine, happens in case of half doing task, else needing pick up? can push branch origin , let them take down work on it, require cleaning further down line, assume there no nice way solve problem interested in hearing how other people solve issue without creating wasteland of out of date feature branches remotely.


a couple of other things mention, ffwd merging, although in original article cited mentions not ffwd merging cannot see how can without creating huge amount of remote branches. using tortoise git rather command line, should not change anything.

if want latest updates branch, can skip 2 branch switches.

git fetch git merge origin/development_branch 

as questions regarding workflow, it's matter of policy. place of work uses project branches, , take upon ourselves spec out lifespans. know when branch born, , know when needs die. benefit of using -d flag delete branches.

git branch -d feature_branch 

by doing way (and not -d), can ensure branch has been merged mainline. stop otherwise. so, can liberal delete command.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -