A Git wrapper to aid usage workflows
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
modules
ModuleBase.php
README.md
gg

README.md

Git Groper: A Tool to Aid in Common Git Workflows

                .-.
               /  a\_
               \  _.-`
              .'  \
             //    |
            //   ; |
           /{   / /
          /;\.-'.`___\/
         ///-'`\     |
        //'  __/___
 jgs   /`      `-.

Check the help text for details on the different features. (Just invoke the script without any parameters.)

I wrote this tool to aid my team at Quicken Loans at using Git in a consistent fashion. So many common tasks seem to require several commands and thought processes that could be easily eliminated if only there was a script to help.

This is that script.

It was written during "Bullet Time" ... a time we have in IT where time slows and we can take a step back from daily tasks to find ways to improve our skills or processes. It's stuff that we really should be doing, but isn't perhaps a business priority.

Hopefully someone will find some use out of this little tool!

This tool is released under the MIT License. See the top of the script for the full text.

The Git Groper, v0.11

-b,  --branch      Switch to a branch. If it exists locally, simply check it
                   out. If it's on the server, create a new tracking branch
                   and switch to it. If neither, create it, push it to the
                   server, and set the upstream. Menu select if branch
                   omitted. (eg, gg b mybranch)
-m,  --merge       Merge all further arguments into the master branch. Delete
                   the branches after. If none specified, use a list picker.
-p,  --push        Push the current branch to the server and set the server's
                   branch to be the upstream. (eg, gg p)
-dl, --del-local   Delete a branch from the local copy. Menu select if branch
                   omitted. (eg, gg dl mybranch)
-dr, --del-remote  Delete a branch from the origin. Menu select if branch
                   omitted. (eg, gg dr mybranch)
-db, --del-both    Delete a branch from local, then from the origin. Menu
                   select if branch omitted. (eg, gg db mybranch)
-fd, --file-diff   Get a file's diff between 2 adjacent commits. The number
                   provided is how many commits back to look. If you do not
                   supply it, the default of 1 means to get the diff made from
                   the last change. (eg, gg fd file.php 2)
-fr, --file-rev    Echo out the contents of a file some number of revisions
                   ago. The default argument is 1 which would get the previous
                   revision. (eg, gg fr 4 > outfile.php)
-al, --aliases     List git bash aliases! Recommended: gg al >> ~/.bashrc
-v,  --version     Show the Git Groper version.
-h,  --help        this.

(The short-version flags do not require the leading hyphen.)