1
How I create a folder in my repository so I can organize my files and not leave everything in the same repository folder on Github? this can be done by creating the folder using the command line or on itself Github?
1
How I create a folder in my repository so I can organize my files and not leave everything in the same repository folder on Github? this can be done by creating the folder using the command line or on itself Github?
3
A Github repository is a Git repository, and it works exactly like one, either by command line, but also the site provides tools for some of the main commands, which includes creating files, see:
Remember: Git will not add content-free folders to the repository!
In a new repository, create a folder, navigate to it:
git init
mkdir folder
cd folder
Then create a new file, opening the new file in Notepad you can add content, then add the file to Git staging and commit:
New-Item file.txt
Notepad .\file.txt
git add *
git commit -m "New file"
The file was added to the repository, see the log:
git log
Click on the "Create new file" button (1)
In the text box that will open, type the name of the folder, ie "Folder" (1):
To indicate that a new folder is being created, type "/" (character: bar), at this time the text previously typed will be moved to the left becoming a folder:
Then type the name of the file you want to create, make the comment to the commit in the field below the screen, when you finish typing the file contents and make the commit by clicking the button.
1
Just create the folder inside the local repository and put some file in it. Git will automatically recognize it and when you run PUSH that folder as well as the files and subfolders will be synchronized with your remote repository.
Note that Git does not monitor folders but files, so only folders containing some file will be created/synchronized.
Thanks! but in relation to Github there is no way to do there?
On the site t know any options. Maybe it is due to the premise of Github not controlling folders but files and that theoretically the bases of your projects should be defined locally and only then synchronized.
-2
That’s exactly how colleagues explained it, git doesn’t add folders without any content, but I went through the same situation and what I did was create a folder and within that folder create a file and then and then all the basic stages. git add . or the specific file, git status, git commit -m "text".
Browser other questions tagged git github
You are not signed in. Login or sign up in order to post.
Hello! Just create the directory, put some file in (Git does not versioning empty directories), do the commit and then the push. What have you ever tried to do?
– Dherik
Hi! in the question I don’t talk about this problem in detail, but in context it’s the same question steps, so to be precise, I’m new to Github and I don’t know much, but I’ve created a repository
pagina
and uploaded a file from my PC which isindex.html
, but now I need to create a CSS folder to put my filestyle.css
within it.– user178466
Right. You tried to do what I said in my previous comment?
– Dherik
No! I’ll try to find out what a commit or push to try to do, because I don’t know.
– user178466