DEV Community

Ngobrolin IT
Ngobrolin IT

Posted on β€’ Edited on

16

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 🍻

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay