• notice
  • Congratulations on the launch of the Sought Tech site

How do I add an empty directory to a Git repository?

A new warehouse is created, but some directory structures are created, but there is nothing to put in it. The content to be placed is not there yet, and it does not exist yet. What should I do?

Git does not track empty directories, so if you need to track then you need to add files!

That is to say, there is no real empty directory in Git;

There are two ways to create a commit empty directory:

1. Create a ".gitignore" file in the directory with the following contents:

 

  1. # Ignore everything in this directory  

  2. *  

  3. # Except this file  

  4. !.gitignore  

 

This ensures that the directory that others see is empty;

2. Create a "readme" file in the directory

You can add some instructions to the file, or you can add nothing at all.


Tags

Technical otaku

Sought technology together

Related Topic

1 Comments

author

buy lipitor 20mg online & lt;a href="https://lipiws.top/"& gt;atorvastatin 40mg sale& lt;/a& gt; lipitor brand

Fokppg

2024-03-09

Leave a Reply

+