-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitflow.sh
More file actions
56 lines (51 loc) · 2.13 KB
/
Copy pathgitflow.sh
File metadata and controls
56 lines (51 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# ═══════════════════════════════════════════════════
# gitflow — Smart Interactive Git Tool
# Main entry point — loads all modules from lib/
#
# Commands:
# gitflow → push flow
# gitflow --pull → pull & sync
# gitflow --sync → same as --pull
# gitflow --checkout → branch checkout + create
# gitflow --checkout dev → directly checkout dev
# gitflow --continue → finish after conflict fix
# gitflow --clone → clone a repo
# gitflow --log → view push history
# gitflow --help → full documentation
# ═══════════════════════════════════════════════════
# ── Load all modules from lib/ ────────────────────
GITFLOW_DIR="$HOME/.gitflow-cli"
LIB="$GITFLOW_DIR/lib"
source "$LIB/colors.sh"
source "$LIB/help.sh"
source "$LIB/log.sh"
source "$LIB/init.sh"
source "$LIB/clone.sh"
source "$LIB/pull.sh"
source "$LIB/continue.sh"
source "$LIB/push.sh"
source "$LIB/checkout.sh"
source "$LIB/untrack.sh"
source "$LIB/delete.sh"
# ── History file ──────────────────────────────────
HISTORY_FILE="$HOME/.gitflow_history"
# ── Route commands ────────────────────────────────
case "$1" in
--help|-h) show_help ;;
--log|-l) show_log ;;
--clone) clone_flow ;;
--pull|--sync) pull_flow ;;
--continue) continue_flow ;;
--checkout) checkout_flow "$2" ;;
--untrack) untrack_flow "${@:2}" ;;
--delete) delete_flow "${@:2}" ;;
"") push_flow ;;
*)
echo ""
echo -e "\033[0;31m✗ Unknown command: $1\033[0m"
echo -e "\033[2m Run gitflow --help to see all commands.\033[0m"
echo ""
exit 1
;;
esac