Most used commands when working on SharePoint Framework (SPFx) projects

No comments

In this post I would like to do an Inventory of the commands that I use most of the time when I develop SharePoint Framework solutions.

GIT

  • pull: every time (at least every morning) I want to get the last version of a branch, I have to execute git pull (details)
  • add: when I changed one or more files I execute git add . .This way I stage all my changed files for a later commit. (details)
  • commit -m “comment”: whenever I want to commit my latest changed files, but at  least once a day. I always pass a comment describing the changes. (details)
  • push: whenever I want to push my changed to the remote repository, but at least once a day. (details)
  • checkout: a few times a day I need to navigate between branches. If you specify the -b parameter, then a new branch gets created. (details)
  • merge: when I want to merge my branch with some colleagues branch, or with master, I go on the current branch and execute git merge sourceBranch. (details)

Gulp

  • serve –nobrowser: every time I want to start the web server. I user –nobrowser option because I want to call myself the URLs where I would like to test my app.
  • build: if I want to do a quick build of my solution.
  • bundle –ship: when I want to prepare my files for a release.
  • package-solution –ship: package the solution just before updating it in the app catalog.
  • clean: to remove all temporary files

NPM

  • outdated: to check if there are any outdated packages in my solution, so maybe I have to update them. (details)
  • install package@latest: install the last version of a package (npm install @microsoft/generator-sharepoint@latest -g; this will install the last version of the sharepoint generator globally). (details)
  • ls @microsoft/generator-sharepoint –g –depth=0: check the SharePoint generator version. 

Leave a comment