Usage
Quickly get a feel for how to use Git-Tool
Git-Tool has a ton of useful commands, but you can probably get away with knowing only three of them. Let's run through gt open, gt new and gt scratch and show you how they work!

Opening a Repo

So, you've just got Git-Tool installed and want to kick the tyres. The best place to start is the same place you usually do, cloning a repo and opening it up.
1
gt o github.com/SierraSoftworks/git-tool
Copied!
This will automatically clone the repo if it doesn't already exist on your machine and then open the first application in your config file.
You can also launch a specific application if you'd prefer.
1
gt o code github.com/SierraSoftworks/git-tool
Copied!
Take a look at Git-Tool's config registry for a quick way to add applications to your config.

Creating a new Repo

Okay, opening a repo is pretty easy - but how about creating a new one? Well, Git-Tool takes care of all of that for you too. Let's try creating a quick test repo to play around in.
1
gt n --no-create-remote github.com/YOURUSER/git-tool-example1
Copied!
If you'd like to open up the repo you just created (usually we do) you can either pass the -o command line option, or you can set the open_new_repo_in_default_app feature flag.
1
# Tell Git-Tool to automatically open all new repos in your default app
2
gt config feature open_new_repo_in_default_app true
3
4
# Or pass the -o option explicitly
5
gt n -o --no-create-remote github.com/YOURUSER/git-tool-example2
Copied!
We're using the --no-create-remote option here to prevent Git-Tool from automatically setting up a GitHub repo, but you can leave that out when creating real repositories. You can also permanently disable this feature by disabling the create_remote feature flag.

Toying around

We just saw a great example of wanting to play around with something but not really wanting to create repositories for it. That tends to happen quite a lot and Git-Tool has just the command to help make it easier. Meet Scratchpads, the organized, weekly, folder where you can do exactly that.
To open the current week's scratchpad, just run the following.
1
# Open the current week's scratchpad
2
gt s
3
4
# Open a different week's scratchpad
5
gt s 2021w10
Copied!
As with the gt open command, gt scratch lets you open the scratchpad in a specific application if you would prefer.
1
gt s shell
Copied!

More

Of course, this is just the tip of the iceberg, take a look at the commands reference to get an idea of everything Git-Tool can do.
Last modified 20d ago