Documentation
Gut is an easy-to-use git client for Windows, Mac and Linux. It is designed to be simple and intuitive, but also powerful and flexible. Gut is built with Golang which makes it fast and lightweight.
Table of Contents
Installation
Windows
To install gut on Windows, run
scoop bucket add gut https://github.com/julien040/gut-scoop
scoop install gut/gut
MacOS
To install gut on macOS, open the Terminal and run
brew tap julien040/gut && brew install gut
Ubuntu/Debian
To install gut on Ubuntu or Debian, download the deb package and install it
echo "deb [trusted=yes] https://apt.gut-cli.dev /" | sudo tee /etc/apt/sources.list.d/gut.list
sudo apt-get update
sudo apt-get install gut
This will install gut on your system. Once installed, you can use it from the command line.
Fedora/CentOS
To install gut on Fedora or CentOS, download the rpm package and install it
sudo tee /etc/yum.repos.d/gut.repo <<EOF
[gut]
name=Gut Repository
baseurl=https://yum.gut-cli.dev/
enabled=1
gpgcheck=0
EOF
sudo yum update
sudo yum install gut
This will install gut on your system. Once installed, you can use it from the command line.
Getting Started
To get started with gut, run the following command in the Terminal:
gut init
This will create a new git repository in the current directory.
Once the repository is initialized, you can start making changes. For example, you could create a new file, make changes to an existing file, or delete a file.
To save your new changes, run
gut save
Choose a category, enter a title, compose the body, and you're done! Your changes have been saved to Git.
How to
Save changes locally
To save changes locally, run
gut save
This will open an interface where you can select a category, provide a commit title, and optionally add a description. Once you have filled in the information, your changes will be committed to the local repository.
Sync with a remote repository
To sync your local repo with a remote repository, run
gut sync
This will pull in any changes that have been made since the last sync. If no conflict has been detected, Gut will try to push your local changes to the remote repository.
Switch to an existing branch
To checkout to an existing branch, run
gut switch <branch name>
This will check out the branch and change your working tree according to the contents of this branch.
Switch to a new branch
gut switch
can be used to switch to a new branch. To do so,
simply call the command with a branch name that doesn't exist and gut
will create it.
gut switch <new branch name>
Revert changes
Imagine you discover a bug that was introduced two commits ago. You would like to go back to that state. To achieve this, you can run the following command:
gut revert
This command creates a new commit with the content of the commit you
selected, avoiding rewriting the history with git reset HEAD~2
and keeping your coworkers happy.
List your branch by last used
Run
gut branch
Discard Changes Since Last Commit
If you want to discard all the changes you made since the last commit, run the command:
gut undo
If you only want to undo changes to specific files, add them as arguments:
gut undo [file]...
Fix your mess
gut fix
is a magical command that helps you fix your mistakes.
It allows you to:
- Modify the commit message of your last commit
- Modify the changes in your last commit
- Discard changes since your last commit
- Go back to a previous commit
- Move a commit to the right branch
To do so, simply run:
gut fix
See changes between two commits
To see the changes between two commits, run the following command:
gut diff <commit1> <commit2>
This will generate a diff that shows all the changes between the two commits.
Note: If you use GitHub, this will open the comparison view in your preferred browser.
See which branch and commit my HEAD
is on.
To see on which branch and which commit your HEAD is, run
gut whereami
Check which files have been altered since the last commit.
To check which files have been altered since the last commit, run
gut status
This will show you a list of all the files that have been changed since the last commit.
Download a .gitignore
template
Gut also allows you to quickly download a .gitignore
template
for your project. All you have to do is run
gut ignore
and select from a list of commonly used languages and frameworks.
If files that were previously tracked have been added to the .gitignore
, gut will prompt you to remove them.
Merge a branch into the current one
To merge a branch into the current one, run
gut merge <branch-name>
This will merge the changes from the given branch into the current branch. Gut will try to auto-merge the changes, but if conflicts occur, you will have to resolve them before the merge is complete.
If you use GitHub, GitLab, or BitBucket, it will open a pull request to merge the changes.
See the history of commit
To view the history of commits, run
gut history
This will show you a list of all the commits in the current branch, with the most recent commit at the top. You can also view the commit in details by selecting one
Check the status of the repository at a particular commit.
With gut goto
, you can check how your repository was at a
given commit without modifying its history. Simply run:
gut goto <commit-hash>
This will take you to the specified commit and set your working tree to the state of the repository at that time. To go back to the “normal state”, run:
gut switch <current branch>
If you want to create a new branch from this old commit, run:
gut switch <new branch name>
This will create a new branch from the commit you selected with gut goto
.
Add a profile
Git allows you to add profiles to manage authentication for your repositories. To do so, simply run the command:
gut profile add
Remove a profile
If you want to remove a profile, run
gut profile remove <profile-name>
This will remove the profile from your system.
Link a profile to a repository
To link a profile to a repository, run
gut setup auth
This will link the specified profile to the specified repository. Once linked, the profile will be used for authentication when interacting with the repository.
Profile
Gut profiles are the key to managing authentication for multiple repositories. With profiles, you can add, delete, and link different profiles to different repositories.
To create a profile, run
gut profile add
You will then be prompted to enter your credentials. Once you have entered them, the profile will be created and stored on your system.
To delete a profile, run
gut profile remove <profile-name>
This will delete the profile from your system and it will no longer be used for authentication.
To link a profile to a repository, run
gut setup auth
This will link the specified profile to the specified repository. Once linked, the profile will be used for authentication when interacting with the repository.
Security
Gut profiles are securely stored in the system's keychain, meaning credentials are encrypted. When an app requests access to these credentials, your OS will prompt you for permission.
Telemetry
Why Do We Use Telemetry?
Telemetry is used to prioritize development. This data is never shared
with third parties.
By default, telemetry is not enabled. On first launch, gut will ask you if
you want to enable it.
How to Opt-Out?
You can opt-out at any time by running the command gut telemetry disable
.
What Data Is Collected?
The following data is collected:
- Your operating system
- Your CPU architecture
- The number of CPU cores
- The version of Gut
- The command you used
-
Your country (we don't collect your IP address, but use the
CF-IPCountry
header to guess your country through Cloudflare)
Where Is the Data Saved?
We have built a custom pipeline to save Gut's telemetry data in order to avoid Mixpanel, Google Analytics, or other similar services.
Your data goes through Cloudflare to prevent DDOS attacks, is then received by a Digital Ocean server, and later saved into a BigQuery table hosted in Europe.
Commands
gut branch
gut branch
is a command used to list all the branches in a repository.
The current branch is highlighted in green. Branches are sorted by last accessed.
gut branch rm [branch]
is a command used to delete a specified
branch.
gut clone [url] [path]
gut clone
is used to clone a repository from a remote. It allows
you to clone an existing repository from a remote server and have a local
copy of it.
gut completion
gut completion
is used to generate the autocompletion script
for the specified shell. It allows users to quickly and easily access the
available commands in their shell.
gut diff
gut diff
is used to show changes between commits, and the working
tree.
If no arguments are provided, the diff will be between the current commit and the working tree. When one argument is given, the diff will be between the specified commit and the working tree. If two arguments are supplied, the diff will be between the two specified commits.
gut explain [command]
gut explain
is used to get the equivalent git command for a
gut command.
gut fix
gut fix
is a magical command that helps you fix your mistakes.
It allows you to modify the commit message of the last commit, modify the
changes in the last commit, discard changes since the last commit, go back
to a previous commit, and move a commit to the right branch.
gut goto [commit hash]
gut goto
is used to check the status of the repository at a
particular commit. It allows you to check how the repository was
at a given commit without modifying its history.
gut help [command]
gut help
is used to get help about any command. It displays
a detailed description of the available gut commands.
gut history
gut history
is used to view the history of commits. It displays
a list of all the commits in the current branch, with the most recent commit
at the top. You can type to filter the commits.
gut ignore
gut ignore
is used to download a .gitignore
template
for a project.
gut init
gut init
is used to initialize a new git repository. It creates
a new git repository in the current directory.
gut merge [branch]
gut merge
is used to merge a branch into the current one. It
merges the changes from the given branch into the current branch, and if
conflicts occur, users will have to resolve them before the merge is complete.
Gut will attempt to open a pull request, if possible, instead of using git merge
.
gut profile
gut profile
is used to manage authentication for multiple repositories.
It allows users to add, delete, and link different profiles to different
repositories.
gut remote
gut remote
is used to list remote repositories. It displays
a list of all the remote repositories connected to the current repository.
gut remote add
is used to add a remote repository.
gut remote rm
is used to remove a remote repository.
gut revert
gut revert
is used to revert to a specified commit. It creates
a new commit with the content of the commit the user selected.
gut save
gut save
is used to save changes locally. It enables you to
record new modifications to your code. You can select a category, provide
a commit title, and optionally add a description.
gut setup
gut setup
is an alias of gut init
. It is used
to initialize a new git repository.
gut setup auth
enables you to connect a profile to a repository.
gut status
gut status
is used to check which files have been altered since
the last commit. It displays a list of all the files that have been changed
since the last commit.
gut switch [branch or new branch name]
gut switch
is used to change the current branch. It checks out
the branch and changes the working tree according to the contents of this
branch.
If an unknown branch name is specified, a new branch will be created.
gut sync
gut sync
is used to sync the local repo with a remote repository.
It pulls in any changes that have been made since the last sync and tries
to push the local changes to the remote repository.
gut undo [files]…
gut undo
is used to discard all the changes made since the last
commit. It allows users to rollback files to the last commit.
If a list of files is provided, gut undo
will only discard the
changes made to those files, rather than the entire working tree.
gut whereami
gut whereami
is used to see which branch and commit the HEAD
is on.