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 🍻

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

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 πŸ‘

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay