Tag Archives: VS Code

Select all matches in VS Code

I came across a need to select all matches in VS Code. This was the procedure, thanks to stack overflow. I altered them for Mac, since that’s what I was using. For Windows/Linux, substitute CMD with CTRL

  1. CMD + F
  2. Type your search string
  3. CMD + SHIFT + L to select all occurrences found (max. 999)
  4. ESC (or close search dialog with top-right X)
  5. CMD + C
  6. Open new file
  7. CMD + V

Works great! It’s a way for me to easily get ONLY my search string from a file and discard the rest.

GIT branch and merge from vs code

I’ve configured VS Code to follow git best practices when it comes to creating branches and merging via pull requests. Here are my notes:

Install gitlens plugin

To open the command pallet: F1 or Command Shift P
CP is short for Command Pallet for following commands.

CP : git clone

  • Enter <repo URL> -> select destination
  • optional: add folder to workspace (bottom right)

CP: git add remote

  • select repository -> label upstream

CP: git fetch from all remotes

CP: git create branch from

  • select repo -> provide name -> select upstream/master

Click on a file in the repo, verify you’re in your new branch (bottom left)

Publish branch to your repo:

CP: git publish branch

  • select repo -> origin

Make your changes

Commit your changes to your branch (git icon on the left – type commit message, optionally compare files) – hit check mark to commit

— your changes are committed to your personal repo branch —

Log into gitlab, go to repo, click Compare & pull request

If you ever need to remove upstream URL:

CP: git remove remote