Before installing Visual Studio Code, I found that things go smoother if I install a few things, first:
git config --global credential.helper wincredFollowing is an example PowerShell script that can be executed within the Visual Studio Code terminal to ensure that a list of extensions have been installed:
$RecommendedExtensions = @( 'abusaidm.html-snippets', 'Angular.ng-template', 'christian-kohler.npm-intellisense', 'christian-kohler.path-intellisense', 'DavidAnson.vscode-markdownlint', 'dbaeumer.jshint', 'dbaeumer.vscode-eslint', 'DotJoshJohnson.xml', 'ecmel.vscode-html-css', 'EditorConfig.EditorConfig', 'eg2.tslint', 'eg2.vscode-npm-script', 'esbenp.prettier-vscode', 'fknop.vscode-npm', 'formulahendry.auto-close-tag', 'HookyQR.JSDocTagComplete', 'johnpapa.Angular2', 'johnpapa.angular-essentials', 'johnpapa.winteriscoming', 'lolkush.quickstart', 'mkaufman.HTMLHint', 'msjsdiag.debugger-for-chrome', 'ms-mssql.mssql', 'ms-vscode.csharp', 'ms-vscode.PowerShell', 'natewallace.angular2-inline', 'sidthesloth.html5-boilerplate', 'xabikos.JavaScriptSnippets', 'Zignd.html-css-class-completion')$InstalledExtensions = (code --list-extensions) -split '\r\n?|\n';$RecommendedExtensions | ForEach-Object { if ($InstalledExtensions -contains $_) { "$_ is already installed." | Write-Host; } else { code --install-extension $_; }}I have found that for some modules, it is best to install them globally if you intend to use them. When you actually use them in your project, it's good to install them locally as well. Following are some of the modules I found I needed to install globally:
The following command will produce a bare minimum list of modules that will need to be installed in order to reproduce re-produce the global module installations on another environment:
((npm list -g) -split '\r\n?|\n') | Where-Object { $_ -match '^[`+]--' } | ForEach-Object { $_.Substring(4) }Many times, when a new local clone of a remote repository is created, sync and push commands will fail, saying there is no upstream branch. This can be fixed with the following command, replacing "remoteName" with the name of the remote repository and "remoteBranch" with the name of the remote branch (which is typically the name of the current branch):
git branch --set-upstream-to remoteName/remoteBranchSo, if your remote repository name is "origin", and your current branch is "master", then the actual command would be:
git branch --set-upstream-to origin/masterIf you aren't sure what the name of the remote repository is, simply use the following command:
git remoteTypically, you would be able to see the name of the current branch in the lower-left corner of the Visual Studio Code editor window. Alternatively, you can see what the name of the currently checked out branch is by using the following command:
git branchYou don't have to have a branch checked out in order to configure the upstream branch. To see a list of all the branch names use:
git branch -aIf you wish to delete a branch, you can use the following command:
git branch -D name_of_branch