DEV Community

Ngobrolin IT
Ngobrolin IT

Posted on β€’ Edited on

18

How to Create Zip Your Code From Visual Studio Code

Hello, dev.. πŸ‘‹

In this tutorial, I will share about how to create a zip file of your code directly from Visual Studio Code without an addon. We need a terminal to execute our command line.

For example, we want to zip the mahal folder, so we open the terminal from the themes folder. Right-click on the themes folder and select "Open in Integrated Terminal".

Integrated Terminal on VS Code

After your terminal command line is open, you can execute this command

zip -r mahal.zip mahal -x '*.git*'
Enter fullscreen mode Exit fullscreen mode

Explanation:

  • mahal.zip is the name of the zipped file. You can change with your need.
  • -r means to zip a directory recursively. This option helps you to zip all the files present in the specified directory.
  • -x means exclude the files in creating the zip. For example, we exclude the .git folder from zipping.

Good luck 🍻

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (3)

Collapse
 
john_knight profile image
John Knight β€’

Sorry, this does not work. 'zip' is not natively available in VS Code and results in:

zip : The term 'zip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.

I'll post back here if I find how to fix this.

Collapse
 
ngobrolinit profile image
Ngobrolin IT β€’

Hey bro, the "zip" command is natively available in Mac OS. If you are a Mac user, this tutorial should work for you.

Collapse
 
john_knight profile image
John Knight β€’

Ah, thanks for clarifying that ☺️

I was using Windows at the time, appreciate you replying πŸ‘

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs