DEV Community

Cassidy Williams
Cassidy Williams

Posted on • Originally published at cassidoo.co on

Have GitHub Copilot see your diff (and other cool tricks)

I learned today that you can have GitHub Copilot pay attention specifically to the current changes in your repository!

I had been working on a branch for a few days on a project, and realized I broke something along the way. I had been working just long enough that scouring the git diff would probably take a while, but I also wanted to parse a bit more about what I had specifically done in certain files.

And thus, I learned about #changes! When you use GitHub Copilot (specifically the chat mode, I personally use VS Code), you can use #changes as a variable in your message to list out your current changes before you commit.

So, for example you can say:

Summarize all of my #changes so far

or, how I used it…

I broke the Feed component. Which files touch the component currently in #changes?

Kinda nice! If you want to check out the docs, there’s a bunch of variables you can use too, like:

  • #usages as a combination of “Find All References”, “Find Implementation”, and “Go to Definition”
  • #selection for the current editor selection as context
  • #searchResults for the results from your latest search as context
  • #fetch to get the content of a web page

(and mooooore)

Hope this was helpful!

Top comments (0)