`hit-on` provides the `hit` binary with a convenient command-line interface to improve the interaction with [`git`][git] in a compatible way with the described working methods. It saves time for people who use this workflow on a daily basis, helps beginners expand their insight of the core VCS processes and makes collaboration between team members easier during development.
> **NOTE:** the project is written in Haskell, so you need to have one of the Haskell build tools installed. See this [blog post](https://kowainik.github.io/posts/2018-06-21-haskell-build-tools) for installation and usage instructions.
You need to follow these steps:
1. Clone the repository from GitHub
```shell
git clone https://github.com/kowainik/hit-on.git
```
2. Step into the directory
```shell
cd hit-on
```
3. Install the project with one of the build tools
Currently, this method of installation is not supported. See [this issue](https://github.com/kowainik/hit-on/issues/41) for more details or if you want to help.
#### Ubuntu package manager
Currently, this method of installation is not supported. See [this issue](https://github.com/kowainik/hit-on/issues/42) for more details or if you want to help.
1. [Create OAuth token on GitHub.](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) The following scopes for the token should be specified:
![Screenshot from 2019-03-16 22-34-57](https://user-images.githubusercontent.com/4276606/54476778-30793c00-483c-11e9-9625-a4f6ced40820.png)
The best way to demonstrate the power of the `hit` tool on a day-to-day basis with our workflow is to go through the entire workflow step by step, solving an ordinary problem of the typical [`git`][git] user.
When you want to start working on a new issue, you usually want to make sure you're using the latest version of your project. As a `git` user you may use the following commands:
Now you need to decide which issue you want to work on. You can use the `hit issue` command to see the full list of all open issues. After choosing the number of the issue, let's say 42, call `hit issue 42` to see the details of that issue.
### hit new
Start your work in a new branch. According to our workflow, branch names should have the following form:
Note that you don't need to keep in mind the current issue number. However, if you want to refresh the context about the issue, use the `hit current` command.
### hit push
After committing your changes locally, you need to push them to the remote repository. It's usually a good practice to push only the current branch.
The `git` command for this is a little bit verbose:
After opening the pull request, some of the reviewers suggested changes that you applied as commits to the remote branch via GitHub interface. Now you need to sync your local branch with the remote one.
While you were waiting for the second round of reviews, another pull request was merged to the `main` branch. Now you need to apply the new `main` changes to your local branch.
Now you need to make changes to your work locally according to the code review and push them to the remote repository.
`git` requires from you to do several steps to accomplish this simple task:
```shell
git add .
git commit -m "Fix after review"
git push origin my-login/42-short-desc
```
`hit` helps you with this as well:
```shell
hit fix
```
### hit amend
Oops, you've just realised that you have made a typo in your work! So you fixed the typo. But now you want to update the remote branch without creating a new unnecessary commit.
With `git` you can do the following:
```shell
git commit -a --amend --no-edit
git push origin my-login/42-short-desc --force
```
With `hit` you can simply:
```shell
hit amend
```
### hit resolve
Hooray, your PR just got merged! It's time to clean your local repository and start working on a new issue!