Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload folders on GitHub

Tags:

github

How can I upload folders to GitHub? I have all of my code in a folder, containing 98 files, on my desktop. I know how to upload files, but it there a way to upload the entire folder?

Thanks!

like image 233
Lanie909 Avatar asked Nov 21 '16 12:11

Lanie909


People also ask

How do I add an entire folder to a Git repository?

The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area.


2 Answers

This is Web GUI of a GitHub repository:

enter image description here

Drag and drop your folder to the above area. When you upload too much folder/files, GitHub will notice you:

Yowza, that’s a lot of files. Try again with fewer than 100 files.

enter image description here

and add commit message

enter image description here

And press button Commit changes is the last step.

like image 92
Do Nhu Vy Avatar answered Sep 22 '22 08:09

Do Nhu Vy


You can also use the command line, Change directory where your folder is located then type the following :

git init git add <folder1> <folder2> <etc.> git commit -m "Your message about the commit" git remote add origin https://github.com/yourUsername/yourRepository.git git push -u origin master git push origin master   
like image 41
Adnan Azmee Avatar answered Sep 22 '22 08:09

Adnan Azmee