Commit graph

157 commits

Author SHA1 Message Date
sandroid 165aeabc42
feat: add option to disable auto creating branches
Adds `$FORGIT_SWITCH_AUTO_CREATE_BRANCH` and `$FORGIT_CHECKOUT_BRANCH_AUTO_CREATE_BRANCH`
environment variables that can be set to `false` to prevent `checkout_branch <BRANCH_NAME>` and
`switch_brach <BRANCH_NAME>` from creating new branches when they do not exist. With the environment
variables set to `false`, new branches can still be created explicitly using
`switch_branch -c <BRANCH_NAME>` and `<checkout_branch> -c <BRANCH_NAME>` respectively.
2026-09-02 00:55:23 +02:00
Wenxuan Zhang 2420155e23 fix: preserve LESS options in enter pager
Some checks are pending
ci / build (macos-latest) (push) Waiting to run
ci / build (ubuntu-latest) (push) Waiting to run
ci / commitlint (push) Waiting to run
ci / format (push) Waiting to run
ci / rumdl-check (push) Waiting to run
ci / actionlint (push) Waiting to run
Pass the required color and stay-open flags directly to less so forgit no longer
replaces users' LESS environment options.

Add regression coverage and document the default behavior.
2026-08-25 13:57:48 +08:00
sandroid 3dbcacd3f2
feat: add interactive git restore selector (#537)
Co-authored-by: Javier Tia <floss@jetm.me>
2026-06-16 21:16:26 +02:00
sandroid 9280ebbb01
ci: enforce consistent markdown formatting with rumdl (#511) 2026-04-12 22:18:43 +02:00
sandr01d 3c09fad398
docs: raise required fzf version to 0.60 (#515) 2026-04-11 18:19:17 +02:00
sandroid 12ec178093 feat: add interactive checkout file from commit selector
closes #476
2026-03-17 17:21:28 +01:00
Wenxuan f7e2d436de
fix: use non-interactive pager in fzf preview for TUI pagers (#498)
When users configure a TUI/interactive diff pager (e.g., diffnav, tig)
via `git config pager.diff`, fzf preview panes show blank output because
TUI pagers require a TTY that fzf previews don't provide.

Add FORGIT_PREVIEW_PAGER env var that overrides the diff pager only in
fzf preview context. Preview detection relies on a FORGIT_IN_PREVIEW
marker set by a new `_forgit_preview` wrapper, so the override applies
only to preview commands and leaves fullscreen behavior unchanged.

Fixes #491
2026-03-14 10:38:44 +08:00
Wenxuan Zhang 7f9ea3a4b1 feat: add interactive worktree add command (gwa)
Add `gwa` command for interactively creating git worktrees with
fzf-powered branch selection.

Usage:
- `gwa`: select a branch to create a worktree for
- `gwa <new-branch>`: create a new branch from a selected base branch
- 2+ args: fall back to `git worktree add` directly

New worktrees are created under `$FORGIT_WORKTREE_ADD_DIR` (defaults to
`<repo-root>/.wt/`) and the shell automatically cd's into the result.
2026-03-12 10:07:34 +08:00
Wenxuan Zhang e20071e29b
docs: add star history chart 2026-03-11 14:41:49 +08:00
Wenxuan Zhang fb314ba7b8 docs: add contribution guide
Co-authored-by: carlfriedrich <45259958+carlfriedrich@users.noreply.github.com>
Co-authored-by: sandr01d <88739791+sandr01d@users.noreply.github.com>
2026-03-11 00:45:51 +08:00
Wenxuan Zhang 5388e0ba2d
docs: update README headers for cleaner rendering
Demote header hierarchy by one level and convert top-level sections
to Setext-style H2 with dash underlines. Sub-sections become H3/H4.
This produces smaller, more elegant headers on GitHub.
2026-03-10 18:57:51 +08:00
Wenxuan Zhang fc081846c0 feat: add interactive git worktree operations
Add worktree browser (gwt) and worktree delete selector (gwd) with:
- Interactive worktree list with lock status, branch info, and age
- Preview showing working tree status and recent commits
- Ctrl-Y to copy worktree path, Alt-L to toggle lock/unlock
- Shell integration for zsh (with cd) and fish (with cd)
- Tab completions for zsh, bash, and fish
- Documentation in README with keybindings and options

Co-Authored-By: Sufien Tout <sufientout@gmail.com>
2026-03-10 09:20:16 +08:00
sandr01d b3e8b3eae8
docs: add docs for 'show commit message' keybinding (#492) 2026-03-09 18:16:02 +01:00
Wenxuan Zhang 4747dedb86
docs: move pager config out of per-command table into own section
Remove sparse Pager column from the per-command options table and
promote the pager fallback info to a standalone "## Pagers" section.
2026-03-07 12:14:56 +08:00
Wenxuan Zhang f016d18975
docs: restructure README for improved navigation
Reorder sections: Features > Installation > Usage > Configuration.
Convert features list to table, merge per-command config tables,
move Completions under Installation, extract Shell Aliases and
Git Integration into a new Usage section.
2026-03-07 12:09:10 +08:00
Wenxuan Zhang 605430e8b8
docs: update sheldon version in README
Update sheldon example from 25.02.0 to 26.01.0 and add a comment
pointing to the releases page.
2026-03-07 11:44:52 +08:00
Wenxuan Zhang 9ad86dd528
style(docs): capitalize section headings in README
Capitalize Options sub-section headings for consistency with the
Installation section's heading style.
2026-03-07 11:44:42 +08:00
Wenxuan Zhang 04cff88bc6
docs: improve options documentation in README
- Move FORGIT_GLO_FORMAT from pagers table to other options table
  where it belongs, and clarify its relationship to FORGIT_LOG_FORMAT
- Add FORGIT_LOG_GRAPH_ENABLE to other options table
- Add FORGIT_COPY_CMD to other options table (previously only
  mentioned briefly in the Keybindings section)
2026-03-07 11:44:30 +08:00
Wenxuan Zhang 699cb93cf2
docs: add missing attributes command to README
Add the interactive .gitattributes generator (gat) to the Features
section, which was present in the source code and alias list but
missing from the feature list.
2026-03-07 11:44:07 +08:00
Wenxuan Zhang 396b7edea4
fix(docs): fix typos and broken markdown in README
- Fix typo: gitatrributes → gitattributes
- Remove extra quote in fzf install link
- Add missing spaces before parentheses in Tips section
- Remove .git suffix from bat repository link
2026-03-07 11:43:55 +08:00
Iván Sotillo del Horno 3cd63a1bbe
Feature: add interactive git switch selector (#472) 2025-12-10 20:19:26 +01:00
sandr01d 779b59690f
Feature: allow configuring arguments of git ls-files in forgit clean (#481) 2025-12-08 20:24:11 +01:00
sandroid d08c9e5477 Docs: improve completion docs and move them to the top 2025-06-04 16:58:31 +08:00
sandr01d 455e42ba64
Feature: add interactive reword selector (#443) 2025-05-29 20:51:12 +02:00
sandr01d c2b012855f
Feature: add interactive squash selector (#440) 2025-05-25 18:21:56 +02:00
carlfriedrich 18f1a1e0c3
Meta: Improve the documentation for overriding aliases (#426)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
2025-02-24 14:09:06 +01:00
crazy-matt 4dc0f5474a
Update README.md (#425)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
Adding sheldon.cli configuration for zsh as an example.
2025-02-23 13:09:51 +01:00
sandroid 0d65efc769 Feature: Add interactive git attributes generator
Some checks failed
ci / build (macos-latest) (push) Waiting to run
ci / build (ubuntu-20.04) (push) Waiting to run
ci / build (ubuntu-22.04) (push) Failing after 1s
2025-02-14 20:29:33 +01:00
carlfriedrich bb83b3cba0
Feature: add forgit show command (#417)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
Introducing `show` as a new subcommand of `forgit`, an interactive
version of `git show`. The configured default alias is `gso`.

Alt-T can be used to toggle between showing the diff and the commit
message in the fzf preview window.

The new command in used instead of `forgit diff` when pressing enter
in `forgit log`. This fixes the display of diffs for merge commits.

**Note**: we have a requirement for the `fzf` version now. The minimum
required `fzf` version is 0.49.0. If the installed version is lower,
forgit will exit with an error message.

Fixes #416.
2025-01-29 07:04:07 +01:00
sandr01d fdae9cb235
Meta: add tree as an optional dependency (#420)
Some checks failed
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
ci / build (ubuntu-22.04) (push) Failing after 1s
2025-01-22 20:28:56 +01:00
Wenxuan Zhang 755b3dd9f8
chore: rename default branch (#410) 2024-12-16 22:35:07 +08:00
Ondřej Súkup 60b651de7e
Meta: remove mention of Fig from docs (#400)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 0s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
Fig was effectively sunset by Amazon from 1. September 2024
2024-10-18 11:37:52 +02:00
sandr01d be82c47ceb
Feature: Add interactive git reflog (#398)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
2024-09-04 22:02:27 +02:00
ccoVeille f3616b00cf
Fix typos in README.md (#390)
* Fix some typos and wordings
* Fix headers style: no double spaces
* Fix "e.g." usage (Latin)
2024-04-24 19:50:11 +02:00
sandr01d bc408f155c
Add a preview to _forgit_clean (#383) 2024-04-19 21:12:16 +02:00
Chris Apple 00ed721ece
Consolidate zsh completions in one file (#340)
Moved the completion definitions for zsh that previously were in completions/git-forgit.zsh and had to be sourced manually on shell startup into completions/_git-forgit, where they are automatically handled by compinit on shell startup. Sourcing a file to get completions is no longer necessary for zsh users.
If you're having issues after updating, and completions for commands such as `forgit::add` or aliases like `ga` aren't working, remove your completions cache (~/.zcompdump) and restart your shell.
Simplified _git-forgit to allow it to be called from within the completion script on the first run of a session.

---------

Co-authored-by: sandr01d <88739791+sandr01d@users.noreply.github.com>
2024-02-09 22:17:22 +01:00
Chris Apple ab7400ddb3
README: Add more explicit instructions for brew, fix headers for AUR, Fig (#339)
Added more explicit instructions, now that I know how our brew installation process works.

While I was there, I moved AUR and Fig to be subheaders of Installation
2024-01-30 06:43:52 -08:00
Chris Apple c663dc1764
README tweak: decrease level of headers (#337) 2024-01-29 10:49:11 -08:00
Edwin Kofler d7f88d75b6
Remove extraneous PATH export (#329) 2023-12-20 06:50:44 -08:00
sandr01d 6cbbe1805a
Removed the note about using forgit as a git subcommand from the 'tips' section (#321)
The note was redundant because it is explained in more detail in the 'git integration' section.
2023-08-06 16:52:49 +02:00
Michael Bianco f1ac9e3f7f
docs: example of using config vars to sort git branch (#319) 2023-07-12 10:59:30 -07:00
sandr01d 500808d73b
Add AUR release action (#315) 2023-07-04 10:06:00 +08:00
Wenxuan c78c10a028
feat: add a keybind to open current file in editor (#313)
* feat: add a keybind to open current file in default editor

---------

Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
Co-authored-by: sandr01d <88739791+sandr01d@users.noreply.github.com>
2023-06-19 09:26:07 +08:00
sandr01d ec1bd21468
Added completions for zsh (#310) 2023-06-13 21:55:50 +02:00
Tom f73ae9754e
Allow configuration of checkout_branch branch cmd (#307) 2023-05-16 08:45:18 -07:00
Patrick Linnane e8ad636ab0
README: add brew instructions (#302) 2023-05-04 08:38:26 +02:00
Tim adf4e7feb9
Fix wrong documentation of tab toggle direction (#299)
See https://github.com/junegunn/fzf/issues/3256 for reference.

Fixes #298
2023-04-26 13:15:33 +02:00
Tim 3f00348d5c
Add keybinding ctrl+y for copying stash ID in gss (#295) 2023-03-18 16:35:18 +01:00
Tim 2a2ee36d56
Add git options for each forgit command (#292)
The git behavior within forgit can now be customized with a dedicated
variable for each forgit command, e.g. `FORGIT_ADD_GIT_OPTS` is passed
to the `git add` call within `ga`.

Also renaming `FORGIT_STASH_PUSH_OPTS` to `FORGIT_STASH_PUSH_FZF_OPTS`
and `FORGIT_REVERT_COMMIT_OPTS` to `FORGIT_REVERT_COMMIT_FZF_OPTS`
for consistency.
2023-03-18 12:25:20 +01:00
Christian Fratta 065f7841f3
Meta: Include oh-my-zsh install instructions in README (#283) 2023-02-10 10:26:59 +01:00