gawkworkflow: Repo Maintenance

 
 7 Keeping Your Repo Organized
 *****************************
 
 There are a few commands you should know about to help keep your local
 repo clean.
 
 _Removing old branches_
      Developers add branches to the Savannah repo and when development
      on them is done, they get merged into 'master'.  Then the branches
      on Savannah are deleted (as shown in SeeGeneral practices).
 
      However, your local copies of those branches (labelled with the
      'origin/' prefix) remain in your local repo.  If you don't need
      them, then you can clean up your repo as follows.
 
      First, remove any related tracking branch you may have:
 
           $ git pull                                Get up to date
           $ git branch -d feature/merged-feature    Remove tracking branch
 
      Then, ask Git to clean things up for you:
 
           $ git fetch --prune                       Remove unneeded branches
 
 _Removing cruft_
      As Git works, occasional "cruft" collects in the repository.  Git
      does occasionally clean this out on its own, but if you're
      concerned about disk usage, you can do so yourself using 'git gc'
      (short for "garbage collect").  For example:
 
           $ du -s .                               Check disk usage
           -| 99188   .                            Almost 10 megabytes
           $ git gc                                Collect garbage
           -| Counting objects: 32114, done.
           -| Delta compression using up to 4 threads.
           -| Compressing objects: 100% (6370/6370), done.
           -| Writing objects: 100% (32114/32114), done.
           -| Total 32114 (delta 25655), reused 31525 (delta 25231)
           $ du -s .                               Check disk usage again
           -| 75168   .                            Down to 7 megabytes
 
 _Renaming branches_
      Occasionally you may want to rename a branch.(1)  If your branch is
      local and you are on it, us:
 
           $ git branch -m feature/NEW-NAME
 
      Otherwise, use:
 
           $ git branch -m feature/OLD-NAME feature/NEW-NAME
 
      You then need to fix the upstream repo.  This command does so,
      using an older syntax to simultaneously delete the old name and
      push the new name.  You should be on the new branch:
 
           $ git push origin :feature/OLD-NAME feature/NEW-NAME
 
           NOTE: It is the leading ':' in the first branch name that
           causes Git to delete the old name in the upstream repo.  Don't
           omit it!
 
      Finally, reset the upstream branch for the local branch with the
      new name:
 
           $ git push -u origin feature/NEW-NAME
 
    ---------- Footnotes ----------
 
    (1) This discussion adopted from here
 (https://multiplestates.wordpress.com/2015/02/05/rename-a-local-and-remote-branch-in-git).