Skip to content

Commit 1ec5763

Browse files
author
elvis kahoro
committed
feat: Graphite: Adding some of the core Grpahite workflows from the Graphite cheatsheet website:
https://graphite.dev/docs/command-reference
1 parent 3657187 commit 1ec5763

11 files changed

Lines changed: 134 additions & 0 deletions
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Graphite - Checkout a branch
3+
command: "gt bco {{branch_name}}"
4+
tags:
5+
- graphite
6+
description: "Often used when wanting to check out a singular branch for collaboration OR personal use."
7+
arguments:
8+
- name: branch_name
9+
description: The name of the branch that you want to checkout
10+
default_value: main
11+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
12+
author: graphite
13+
author_url: "https://graphite.dev/"
14+
shells: []

specs/graphite/gt_branch_down.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Graphite - Move down the stack of branches
3+
command: "gt branch down {{step}}"
4+
tags:
5+
- graphite
6+
description: "Quickly move down a stack of branches. By default, takes a step argument of 1, but can add a step value (ex. gt branch up 2) to skip a certain number of branches."
7+
arguments:
8+
- name: step
9+
description: The number of branches to pass when traversing the stack of branches.
10+
default_value: 1
11+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
12+
author: graphite
13+
author_url: "https://graphite.dev/"
14+
shells: []

specs/graphite/gt_branch_list.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Graphite - Log or show the stacked branch tree
3+
command: "gt ls"
4+
tags:
5+
- graphite
6+
description: "This might be glaringly obvious, but any time branches are created/manipulated/changed, we run this command as if it were second nature. Most of our engineers prefer the truncated (ls) log to the full log."
7+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
8+
author: graphite
9+
author_url: "https://graphite.dev/"
10+
shells: []
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Graphite - Create a branch with an accompanying commit message
3+
command: "gt bc -am {{commit_message}}"
4+
tags:
5+
- graphite
6+
description: "Creating some changes, staging those changes, creating a new branch and committing those changes to the new branch is way too much work. Create your changes and run this single-line command to do all of that in one go. Compare to: `git checkout -b <branch_name> && git add . && git commit -m <commit message>`"
7+
arguments:
8+
- name: commit_message
9+
description: The message to assign to this commit.
10+
default_value: ~
11+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
12+
author: graphite
13+
author_url: "https://graphite.dev/"
14+
shells: []

specs/graphite/gt_branch_up.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Graphite - Move up the stack of branches
3+
command: "gt branch up {{step}}"
4+
tags:
5+
- graphite
6+
description: "Quickly move up a stack of branches. By default, takes a step argument of 1, but can add a step value (ex. gt branch up 2) to skip a certain number of branches."
7+
arguments:
8+
- name: step
9+
description: The number of branches to pass when traversing the stack of branches.
10+
default_value: 1
11+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
12+
author: graphite
13+
author_url: "https://graphite.dev/"
14+
shells: []
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Graphite - Get downstack from remote
3+
command: "gt dsg {{branch_name}}"
4+
tags:
5+
- graphite
6+
description: "A popular command for getting a stack locally that's been created/manipulated by someone else. Oftentimes followed up with gt bdl to delete irrelevant branches locally."
7+
arguments:
8+
- name: branch_name
9+
description: The name of the branch that you want to fetch from remote
10+
default_value: main
11+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
12+
author: graphite
13+
author_url: "https://graphite.dev/"
14+
shells: []
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Graphite - Jump to the bottom of the stack
3+
command: "gt bb"
4+
tags:
5+
- graphite
6+
description: "Quickly move all the way down (bb) the stack"
7+
arguments: []
8+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
9+
author: graphite
10+
author_url: "https://graphite.dev/"
11+
shells: []
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Graphite - Submit stack
3+
command: "gt ss"
4+
tags:
5+
- graphite
6+
description: "Submit your changes across all PRs on a stack."
7+
arguments: []
8+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
9+
author: graphite
10+
author_url: "https://graphite.dev/"
11+
shells: []

specs/graphite/gt_stack_up.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Graphite - Jump to the top of the stack
3+
command: "gt bt"
4+
tags:
5+
- graphite
6+
description: "Quickly move all the way up (bt) the stack"
7+
arguments: []
8+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
9+
author: graphite
10+
author_url: "https://graphite.dev/"
11+
shells: []
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Graphite - Synchronize with remote
3+
command: "gt rs -r"
4+
tags:
5+
- graphite
6+
description: "A quick command to pull changes from your trunk branch and subsequently restack upstack changes. Same as `gt repo sync && gt stack restack` under the hood. Also deletes any branches that have been merged."
7+
arguments: []
8+
source_url: "https://graphite.dev/docs/graphite-cheatsheet"
9+
author: graphite
10+
author_url: "https://graphite.dev/"
11+
shells: []

0 commit comments

Comments
 (0)