git-jira-shortcuts 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/shell/git-extras.sh +4 -3
package/README.md
CHANGED
|
@@ -81,7 +81,7 @@ git config --global core.excludesfile ~/.gitignore_global
|
|
|
81
81
|
### Branching
|
|
82
82
|
| Command | Alias | Description |
|
|
83
83
|
|---------|-------|-------------|
|
|
84
|
-
| `gswitch [branch]` | `gw` | Switch branches with interactive picker (↑/↓
|
|
84
|
+
| `gswitch [branch] [--force]` | `gw` | Switch branches with interactive picker (↑/↓). `--force` skips uncommitted and unpushed guards. |
|
|
85
85
|
| `gstart <branch\|ticket#>` | `gt`, `gcreate` | Create or switch to branch, auto-names from Jira |
|
|
86
86
|
| `gdelete [branch]` | `gdel` | Delete feature branch if clean and pushed |
|
|
87
87
|
| `gmerge [branch]` | `gm` | Merge branch into current if no conflicts |
|
package/package.json
CHANGED
package/shell/git-extras.sh
CHANGED
|
@@ -377,7 +377,7 @@ ghelp() { # ghelp | Show all git-jira-shortcuts commands
|
|
|
377
377
|
|
|
378
378
|
── Branching ──────────────────────────────────────────────────
|
|
379
379
|
gw [branch] Switch branches — arrow-key picker if no branch given
|
|
380
|
-
gswitch (same, also accepts --force / -f)
|
|
380
|
+
gswitch (same, also accepts --force / -f to skip dirty or unpushed guards)
|
|
381
381
|
gt <branch|ticket#> Create or switch to a branch — auto-names from Jira
|
|
382
382
|
gstart, gcreate (same)
|
|
383
383
|
gdel [branch] Delete a branch — interactive picker, safety checks
|
|
@@ -596,7 +596,7 @@ greset() { # greset [*file] | Reset a specific file with confirmation (interacti
|
|
|
596
596
|
}
|
|
597
597
|
alias gr='greset' # greset [*file] | Alias for greset
|
|
598
598
|
|
|
599
|
-
gswitch() { # gswitch [*branch] [--force|-f] | Switch branches (
|
|
599
|
+
gswitch() { # gswitch [*branch] [--force|-f] | Switch branches (bypass dirty tree / unpushed guards with --force)
|
|
600
600
|
local force_switch=0
|
|
601
601
|
local -a positional=()
|
|
602
602
|
local arg
|
|
@@ -623,8 +623,9 @@ gswitch() { # gswitch [*branch] [--force|-f] | Switch branches (optionally bypas
|
|
|
623
623
|
local unpushed
|
|
624
624
|
unpushed=$(git log origin/"$branch"..HEAD --oneline 2>/dev/null)
|
|
625
625
|
|
|
626
|
-
if [[ -n "$unpushed" ]]; then
|
|
626
|
+
if [[ $force_switch -eq 0 && -n "$unpushed" ]]; then
|
|
627
627
|
echo "🚫 You have commits on '$branch' not pushed to origin. Push them first."
|
|
628
|
+
echo " Use 'gw --force [branch]' to switch anyway."
|
|
628
629
|
return 1
|
|
629
630
|
fi
|
|
630
631
|
|