-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.flow
More file actions
67 lines (64 loc) · 1.99 KB
/
workflow.flow
File metadata and controls
67 lines (64 loc) · 1.99 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
57
58
59
60
61
62
63
64
65
66
67
# yaml-language-server: $schema=https://flowexec.io/schemas/flowfile_schema.json
namespace: git
description: |
Common git workflow helpers for day-to-day development. Covers committing
and pushing, syncing with the base branch, cleaning up merged branches,
and getting a quick status overview.
tags:
- git
executables:
- verb: push
name: branch
description: |
Stage all changes, commit with a prompted message, and push the current
branch to origin. A clean way to replace scattered git commands.
exec:
params:
- envKey: COMMIT_MSG
prompt: Commit message
cmd: |
git add -A
git commit -m "${COMMIT_MSG}"
git push origin HEAD
echo "Pushed to $(git rev-parse --abbrev-ref HEAD)"
- verb: fetch
aliases: [sync, rebase]
description: |
Fetch and rebase the current branch onto the base branch. Keeps your
branch up to date without creating a merge commit.
exec:
params:
- envKey: BASE_BRANCH
text: main
cmd: |
git fetch origin "${BASE_BRANCH}"
git rebase "origin/${BASE_BRANCH}"
echo "Synced with ${BASE_BRANCH}"
- verb: clean
name: branches
description: |
Delete all local branches that have been merged into main. Runs
`git fetch --prune` first to remove stale remote-tracking refs.
exec:
cmd: |
git fetch --prune
merged=$(git branch --merged main | grep -v '^\*\|main')
if [ -z "$merged" ]; then
echo "No merged branches to clean up"
else
echo "Deleting merged branches:"
echo "$merged"
echo "$merged" | xargs git branch -d
echo "Done"
fi
- verb: get
name: status
description: Show a compact working-tree status and the last 10 commits.
exec:
logMode: text
cmd: |
echo "=== Working tree ==="
git status --short
echo ""
echo "=== Recent commits ==="
git log --oneline -10