Development
These commands exist to make your development life a bit easier.
Git-Tool is capable of more than just file organization, its great cross-platform autocomplete support makes it ideally suited to solving some other common problems we run into during our day-to-day development.

switch

Git has recently shipped with a wonderful new switch command which simplifies changing branches (when compared to the sometimes confusing git branch and git checkout -B combination). We're big fans of Git-Tool's autocomplete though, so we've wrapped all the lovely git goodness up in Git-Tool and paired it with our search engine to make your life just that much easier.
This command has replaced the old gt branch command since v2.2.0 as it serves the same purpose and uses the same command line arguments.

Aliases

    gt switch
    gt sw
    gt branch
    gt b
    gt br

Options

    -N, --no-create prevents the branch from being created if it doesn't exist already.

Example

1
# Checks out the feature/demo branch, creating it if it doesn't exist yet
2
gt sw feature/demo
3
4
# Checks out the feature/demo branch if it exists
5
gt b -N feature/demo
Copied!

ignore

Setting up your .gitignore files and keeping them updated can be a bit of a faff. It takes time, it doesn't add much core value and we often forget little things when then require us to clean out repo history.
gitignore.io is one approach to solving this. It offers a wide range of pre-built .gitignore files for different languages and frameworks. Git-Tool gives you a command which combines this with some useful metadata to allow quick updates and additions.

Aliases

    gt ignore
    gt gitignore

Options

    --path allows you to specify the path to the .gitignore file you wish to update. By default, this will be ./.gitignore.

Example

1
# View the list of all supported .gitignore languages/frameworks
2
gt ignore
3
4
# Add a .gitignore file (or update your existing one) for Node.js and C#
5
gt ignore node csharp
Copied!
Git-Tool will automatically fetch the latest ignore files from gitignore.io for the languages you have added whenever you run gt ignore $LANG and retain changes you made outside the metadata blocks.
Last modified 20d ago