Skip to content

leecardona/vscode-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 

Repository files navigation

Table of Contents

Overview:

Documentation of steps taken to setup and use Visual Studio Code for development on a Mac environment

Setup Steps:

Below are the steps required, with some optional steps , to setup a working VSC environment. These step are typically only performed once.

Base Setup:

vscode welcome screen

Setup git repo:

  • Launch command prompt with keyboard shortcut shift+cmd+p

vscode cmd prompt

  • Inside the cmd prompt, enter the Git: Clone cmd or select it from the dropdown list of common/recent cmds
  • This will prompt you for your repo url e.g. https://github.com/leecardona/vscode-setup.git

repo url prompt

  • After you provide the url and hit enter, you will be presented with a download save dialog box asking you to designate where on your local machine you wish to place this local copy of the repo
  • Once the repo is done downloading, VSC will prompt you on the lower right with post repo download action shorcuts, select Open repository option

Repo Action shortcuts

  • You should now be navigated to the source control management (SCM) tab in VSC. You can also manually select this tab by clicking on the SCM tab icon

vscode SCM tab

Setup Workspace

Optional: This is an optional step but I found that VSC on Mac did not always detect file changes done on the local machine via the finder or if your repo is on a cloud drive like Google Drive or Dropbox. Creating a designated Workspace seems to address this issue. Typically a Workspace is used when you want to save the setup of you VSC working environment. For example, if your project is comprised of more than one repo folder or perhaps in addition to your primary repo folder you want to include some additional folders for quick access via the VSC file explorer tree.

  • Ensure you're in the desired repo by selecting the Explorer tab

explorer tab

  • You should see your repo and it's folder structure in the VSC Explorer

repo in explorer

  • from the File menu, select Save Workspace As...

save workspace as

  • You will be prompted with a local finder dropdown box to select where on your local machine you wish to save the workspace config file

save workspace dialog

  • Once you have named and saved your workspace, note the updated VSC Explorer as it now will denote that the repo is saved as a (WORKSPACE)

repo is a workspace in explorer

Adding Extention for Tag Automation:

Optional: Git tags are used to denote key points in code development that signify a milestone, typically a release of some kind like a major or minor release version, or hotfix. Git hosting services like Github will detect tags and auto create releases for you with nice zipped file links for easy release downloading for end-users. VSC support plugins/extentions that add easy to use features to the user interface of VSC that can make activities like tagging easier to manage.

  • Go to the VSC Marketplace to search and install available extentions. Enter the keyboard shortcut cmd + p Note this brings up the quick actions dialog not the VSC cmd prompt - they are not the same.

vscode actions dialog

  • Once presented with the actions dialog enter: ext install git-tags. I thought this would install the extention but it did not. It only navigated me to the VSC Marketplace and filtered the search for tag related extentions, just be aware.

  • You can also select the VSC Marketplace tab to manually navigate and then enter tags in the search box.

VSC marketplace

  • From the result of tag related extentions select git-tag by clicking on the install button for it.

Workflow Steps:

Below are steps that are performed as part of using VSC on a normal iterative basis.

Committing code and updating remote repo:

Commiting code updates is pretty straight forward in VSC as it should auto detect any changes to your local git repo. When it does, VSC will provide a visual indication by placing a badge over the SCM tab icon denoting how many changes it has deteced, like so:

change detection indicator

  • To commit changes select the SCM tab and you be presented with the commit box as shown below:

commit box

  • To locally commit your changes simply enter a commit message in the provided box and then click on the Check Mark above the message box:

checkin commit

  • Once your changes have been commited you are able to push or sync your changes with the remote repo or perform other actions by selecting the More actions icon, represented by an elipse icon:

commit more actions icon

  • This will result in the actions dropdown dialog appearing. From here simply select the git action you wish to perform for this commit, e.g. push, pull, sync, other...

list of git commit action

Managing tags:

  • To manage tags using the git-tag extention simply navigate to the SCM tab:

vscode SCM tab

  • Select the More actions icon:

commit more actions icon

Create tag

  • To add a tag to the current commit, select Create tag from the dropdown menu:

Create tag

  • This will result in a create tag input dialog box opening:

enter tag dialog box

  • Enter your desired tag value and press enter. You will then be prompted for syncing your remote repo with this tag at this time or not. Normally select Yes to complete this operation.

sync tag?

List tags:

  • Git-tag extention also allows to quickly view all your tags and even delete them if you so desire. To view your tags navigate to the SCM tab:

vscode SCM tab

  • Select the More actions icon:

commit more actions icon

  • To view your tags, select List tags from the dropdown menu:

List tag

  • This will result in a tags list window opening as shown below:

tags window

  • From here you can view all your tags as well as DELETE any you wish to remove

Creating Branches:

  • Creating branches in VSC is pretty easy and is done via the branch switching dialog. To bring up the branch switching dialog click on the current banch indicator at the bottom left of VSC screen:

vscode branch selector

  • This will result in the branch switching dialog as shown below:

vscode branch switcher

  • From here simply click on the + Create new branch option and you'll be presented with an input box to enter your desired branch name:

vscode branch name input

  • VSC also automatically switches you to the new branch once created. You can verify this by noting the current branch indicator at the lower left of the VSC screen:

vscode new branch

  • After the new branch is created be sure to update the remote repo by publishing this change. Simply click the update cloud icon to the right of the current branch indicator to update the remote repo with the new branch:

publish changes to remote

Switching Branches:

  • Switching branches in VSC is pretty easy and is done via the branch switching dialog. To bring up the branch switching dialog click on the current banch indicator at the bottom left of VSC screen:

vscode branch selector

  • This will result in the branch switching dialog as shown below:

vscode branch switcher

  • From here simply select the desired branch from the list of available branches and VSC will automatically switch you to that branch

Merging Branches:

  • Merging branches to pretty straight forward as well. First ensure you are in the target branch you want to update, not the source branch with the new code and/or files . You can check the current banch by looking at the current branch indicator at the bottom left of VSC screen:

vscode branch selector

  • To initiate a merge use the keyboard shortcut combination shift+cmd+p to bring up the VSC command prompt:

vscode merge dialog

  • Inside the cmd prompt, enter the Git: Merge Branch cmd or select it from the dropdown list of common/recent cmds. This will result in the Select a branch to merge from dialog appearing.

select branch to merge

  • Select your source branch from the list of available branches to update the target branch you are currently in.

Deleting Branches:

  • To delete a branch in VSC you have to first ensure you are not currently in the branch you wish to delete or you wont be able to select it for deletion. You can check the current banch by looking at the current branch indicator at the bottom left of VSC screen:

vscode branch selector

  • Once you're sure your not in the branch you wish to delete, enter the keyboard shortcut combination shift+cmd+p to bring up the VSC command prompt:

vscode merge dialog

  • Inside the cmd prompt, enter the Git: Delete Branch cmd or select it from the dropdown list of common/recent cmds. This will result in the Select a branch to delete dialog appearing.

select branch to merge

  • Select the branch from the list of available branches you wish to delete.

Contributing

I welcome and appreciate community contributions. If you have an idea or a question I'd love to hear from you! The easiest ways to contribute is by forking this repo followed by a pull request or raising an issues in this repo's Github.

Copyright

Copyright 2018 Lee Cardona. @leecardona

License

The documentation is provided under Apache License 2.0. Contributions to this project are accepted under the same license.

About

Documentation of steps taken to setup Visual Studio Code development environment (Mac version)

Resources

License

Stars

Watchers

Forks

Packages

No packages published