Imran
Imran

Reputation: 120

Should I "push" a large group of folders from Git to Github?

I'm new to Git and Github but have been making Websites for a while and have several folders of different websites I want to put on my Github repository.

My method, I cloned the repository onto my local drive, transferred the folders, produced the local git using init, add and commit them. Finally, I push them back to my Github repository, the folder was altogether 1.25GB so I presumed there might be issues. I managed to transfer around 60% before I had a fatal error I presumed this was due to there being a limit.

How should I push these folders to Github. Should I make individual repositories for each folder. Or put them all in one larger repository and if so how do I do this

Note: Each folder is a distinct website project.

Upvotes: 0

Views: 508

Answers (2)

Marvin
Marvin

Reputation: 14415

Make one repository per website.

Git always works with the whole repository: you can only clone, tag or branch the whole repository at once. Having all websites in one single repository makes it impossible to e.g. only roll back one of them to a previous version - everything you do will affect all other websites as well. On the other hand, you'll want to have all resources (folders) belonging to a certain website in a single place.

And as you already noticed, the sheer size may become an issue - especially, when transferring data through the internet. Later commits will probably be manageable (as you only have to upload the diffs), but you have to transfer everything at least once.

Regarding the size: 1.25GB seem to be too much for a few websites. I'm assuming you are including binary and/or distribution files. Read about the .gitignore file to help exclude those files from version control. Git will not track files matching patterns specified in that file and subsequently they will not bloat your repository.

Upvotes: 1

Roman Marusyk
Roman Marusyk

Reputation: 24619

1.25GB it is too big. It seems that you are you including binary files or a many images. Plerese read about .gitignore.

Of course, you can push it to GitHu but if your repository exceeds 1GB, you might receive a polite email from GitHub Support requesting that you reduce the size of the repository to bring it back down

Also there is a limit of files exceeding 100 MB in size.

You can try other services like GitLab(10GB repo limit) or Git LFS (for handling large files)

Upvotes: 1

Related Questions