-# reslog=$(git log HEAD..origin/master --oneline)
-# if [[ "${reslog}" != "" ]] ; then
-# git merge origin/master
+ # first update all our remote branches to their current state from the repos.
+ git remote update | $TO_SPLITTER
+ promote_pipe_return 0
+ exit_on_error "git remote update"
+
+ show_branch_conditionally "$this_branch"
+
+ # this code is now doing what i have to do when i repair the repo. and it seems to be good so far.
+ # note that we allow the local branch to be merged with its remote counterpart; otherwise we would
+ # miss changes that happened elsewhere which should be seen in our local copy.
+ local branch_list=$(all_branch_names)
+ local bran
+ for bran in $branch_list; do
+ log_feisty_meow_event "synchronizing remote branch: $bran"
+ git checkout "$bran" | $TO_SPLITTER
+ promote_pipe_return 0
+ exit_on_error "git switching checkout to remote branch: $bran"
+
+ show_branch_conditionally "$this_branch"
+
+ remote_branch_info=$(git ls-remote --heads origin $bran 2>/dev/null)
+ if [ ! -z "$remote_branch_info" ]; then
+ # we are pretty sure the remote branch does exist.
+ git pull --tags origin "$bran" | $TO_SPLITTER
+ promote_pipe_return 0
+ fi
+ exit_on_error "git pull of remote branch: $bran"
+ done
+ # now switch back to our branch.
+ git checkout "$this_branch" | $TO_SPLITTER
+ promote_pipe_return 0
+ exit_on_error "git checking out our current branch: $this_branch"