I am new to Git. I want to add an existing source code folder to Git, but based on the little documentation that I read, I guess files must be a Tar ball or tar.gz archive. I am also not finding a way to add an entire existing folder.
Is it not possible to add non-compressed files to Git repository along with the folder that contains the files?
Select Repos, Files. From the repo drop-down, select Import repository. If the source repo is publicly available, just enter the clone URL of the source repository and a name for your new Git repository.
It depends what you mean by adding a directory to a Git repository.
I get the feeling that you mean that you want to create a new project using an existing directory. In which case, you would need to go inside your directory and use git init. Here a quick guide I just found.
However, if you mean that you already have a Git project and wish to add a directory - the answer is simply to use git add path
Let us know if you need more information (such as setting up a remote, or using github.)
No, you don't need it compressed. Git operates on the filesystem.
If you want to create a new repository from existing source, just cd into that directory and type: git init
.
Add the current state of files to the index with git add .
(note the trailing dot)
If you want to add existing code to an existing repository, you also need git add
(and probably copy the files to where you repo is).
I suggest to take some time to actually learn and understand git before using, because doing so will save you a lot of trouble.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With