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
#changesso 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:
-
#usagesas a combination of “Find All References”, “Find Implementation”, and “Go to Definition” -
#selectionfor the current editor selection as context -
#searchResultsfor the results from your latest search as context -
#fetchto get the content of a web page
(and mooooore)
Hope this was helpful!
Top comments (0)