in Technology by
How to add an empty directory to a Git repository?

1 Answer

0 votes
by

Make a directory stay (almost) empty (in the repository) is to create a .gitignore file inside that directory that contains these four lines:

# Ignore everything in this directory
*
# Except this file
!.gitignore

Related questions

0 votes
    On adding a subproject using git submodule add, how many files will be added in the main repository? (1)4 (2)1 (3)2 (4)3...
asked Jun 1, 2021 in Technology by JackTerrance
0 votes
    Why there is a need to move the existing directory into a new repository? How this can be done in SVN?...
asked Feb 18, 2021 in Technology by JackTerrance
0 votes
    How can we clone a Git repository into a specific folder?...
asked Jan 8, 2021 in Technology by JackTerrance
0 votes
    How to find and restore a deleted file in a Git repository?...
asked Jan 8, 2021 in Technology by JackTerrance
0 votes
    Explain How to change the URI (URL) for a remote Git repository?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    How to determine the URL that a local Git repository was originally cloned from?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    How to push a new local branch to a remote Git repository and track it too?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    How to resolve merge conflicts in Git repository?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    How to revert a Git repository to a previous commit?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    How is a bare repository different from the standard way of initializing a Git repository?...
asked Oct 4, 2020 in Technology by Editorial Staff
0 votes
    How do you push a file from your local system to the GitHub repository using Git?...
asked Oct 4, 2020 in Technology by Editorial Staff
0 votes
    Is it possible to add a file directly to the repository? Which command can be used for this?...
asked Feb 18, 2021 in Technology by JackTerrance
0 votes
    Microsoft now has support for Git repositories on their Team Foundation Service. I have an account on Team ... to TFService. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, ... those forks I pulled? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How do I revert from my current state to a snapshot made on a certain commit? If I do git log, then I get ... , i.e. commit 0d1d7fc? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
...