simonthum / git-sync

Safe and simple one-script git synchronization
773 stars 99 forks source link

Add $branch_name to `git fetch` to ensure extraneous branches are not fetched #5

Closed boombatower closed 10 years ago

boombatower commented 10 years ago

A project I am working has a number of other branches besides the branch that is being synced using git-sync. Currently, all the other branches are needlessly fetched as soon as git fetch is run since it only includes the origin and not the specific branch. Assuming the repository was clone with --branch or has never had other branches fetched the data will not have been pulled, but git-sync insists on doing so.

This pull request simply adds the $branch_name to the git fetch call to ensure only the branch being synced is fetched.

simonthum commented 10 years ago

Thanks, this is a really valuable contribution!