在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:kowainik/hit-on开源软件地址:https://github.com/kowainik/hit-on开源编程语言:Haskell 99.6%开源软件介绍:Hit OnKowainik Git Workflow Helper Tool. You can find the description of the workflow here:
Here is an example of how you can see the list of issues and the issue description with Or how you can see pretty short stats about your changes: Getting startedPrerequisitesTo start using
InstallationThere are several methods to install the Download from releasesYou can download the After downloading, make it executable and copy it to a convenient location, for example: chmod +x hit-linux
mv hit-linux ~/.local/bin/hit Build from source
You need to follow these steps:
macOS package managerCurrently, this method of installation is not supported. See this issue for more details or if you want to help. Ubuntu package managerCurrently, this method of installation is not supported. See this issue for more details or if you want to help. Setting upFollow the steps below to configure
git config --global user.login <your_login>
Commands
UsageThe best way to demonstrate the power of the
hit cloneIf you don't have the repository locally, you need to clone it. With the git clone [email protected]:username/project-name.git
hit clone my-project If this is not your personal repository then you can use hit clone owner-name/project-name hit hopWhen 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 checkout main
git pull --rebase --prune With hit hop hit issueNow you need to decide which issue you want to work on. You can use the hit newStart your work in a new branch. According to our workflow, branch names should have the following form:
With git checkout -b my-login/42-short-desc
hit new 42 It uses the issue title to generate a short description. hit statusBefore commiting your changes, you may want to inspect short stats about your
work. With git status However, the same hit status hit diffIf you want to see detailed diff of your changes, use hit commitAfter finishing your work on that issue, you need to commit your changes. With git add .
git commit -m "[#42] Implement my feature
Resolves #42" With hit commit "Implement my feature" or even simplier: hit commit And the commit name would be the title of the corresponding issue at GitHub (if you are currently in the branch named as described above). 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 pushAfter 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 push -u origin my-login/42-short-desc
hit push
hit syncAfter 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. With git pull --rebase origin my-login/42-short-desc However, with hit sync hit freshWhile you were waiting for the second round of reviews, another pull request was merged to the With git fetch origin main
git rebase origin/main Again, with hit fresh hit fixNow you need to make changes to your work locally according to the code review and push them to the remote repository.
git add .
git commit -m "Fix after review"
git push origin my-login/42-short-desc
hit fix hit amendOops, 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 commit -a --amend --no-edit
git push origin my-login/42-short-desc --force With hit amend hit resolveHooray, your PR just got merged! It's time to clean your local repository and start working on a new issue! With git checkout main
git pull --rebase --prune
git branch -D my-login/42-short-desc With hit resolve hit logHooray, your PR just got merged! It's time to clean your local repository and start working on a new issue! With git log --oneline --decorate [COMMIT_HASH] With hit log [COMMIT_HASH] TroubleshootingIf you see $ hit hop
fatal: ambiguous argument 'origin/HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
hit: readCreateProcess: git "rev-parse" "--abbrev-ref" "origin/HEAD" (exit 128): failed
origin/master
...skipping... then you can run $ git remote set-head origin -a to synchronise with the remote, fetch and set AcknowledgementIcons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论