Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

06/09/2021, 19:13 How to upload an entire folder?

- How to use Git and GitHub - GitHub Support Community

How to upload an entire folder?


shinehah-gnolaum
#1 May 23, 2020, 5:13am

I clicked on my repo in a browser, then I clicked on Upload Files. I would like to upload an entire folder so that GitHub would preserve the hierarchy of the files
and folders in my folder, but I am not able to select folders to be uploaded. How would I upload an entire folder of an XCode project?

12 Likes

📍 The How to Use Git & GitHub Guidepost

lee-dohm
#2 May 23, 2020, 5:45am

There isn’t a way to upload an entire folder through the web UI. The easiest way to do that would be to:

1. Clone the repository locally


2. Make the changes to the local version
3. Commit the changes locally
4. Push the changes back up to the GitHub repository

You can find out more information about this process in our help documentation. Let us know if you have any questions.

15 Likes

ra-hulgupta
#3 May 23, 2020, 5:45am

you should just try to drag and drop your entire folder in the webui and it will upload whole folder.

107 Likes

nadiajoyce
#4 May 23, 2020, 5:45am

Wanted to confirm here, that dragging and dropping a folder into the Web UI will now, indeed, create that folder in (and upload the files within it to) your GitHub
repo. See: https://help.github.com/articles/adding-a-file-to-a-repository/ for more info.

5 Likes

https://github.community/t/how-to-upload-an-entire-folder/1056/print 1/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community

siva-tn
#5 May 23, 2020, 5:45am

I have tried to upload a folder with drag and drop option but it’s not working. So can you please suggest me how to upload an entire folder?

17 Likes

nadiajoyce
#6 May 23, 2020, 5:45am

@siva-tn Is the repo you’re trying to upload the folder to public? If so, can you share the link to it? Also, what file formats are contained in the folder you’re
trying to upload? 

1 Like

matelaszlototh
#7 May 23, 2020, 5:45am

Or use command line:

cd into the directory where your folder is located

type:

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

53 Likes

silent1eye
#8 May 23, 2020, 5:45am

I have tried to drag the folder but it shows folder contains more than 100 files, try with less number of files, is there another way to do so?, i have nearly
train_data images in my folder.

7 Likes

https://github.community/t/how-to-upload-an-entire-folder/1056/print 2/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community

veskoaleksandrov
#9 May 23, 2020, 5:45am

Didn’t work  in FF. GC worked fine though…

2 Likes

advaymehta009
#10 May 23, 2020, 5:45am

not working, only files were uploading not entire folder.

2 Likes

zohaibaamer766
#11 May 23, 2020, 5:45am

how to set path format in git add <folder>

1 Like

tanmaysm
#12 May 23, 2020, 5:45am

Folder upload only works if contains less than 100 files.

2 Likes

joelzehring
#13 May 23, 2020, 5:45am

I’m trying to drag and drop the build folder of a small react app and it doesn’t let me drop it in the web interface. Seems to be less than 100 files in the
directory… Any idea what the problem might be?

1 Like

ptoye
#14 May 23, 2020, 5:45am

Same here (once I’d worked out whatr FF and GC were). Something odd in Firefox I guess.

https://github.community/t/how-to-upload-an-entire-folder/1056/print 3/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community
1 Like

loganchen39
#15 May 23, 2020, 5:45am

I have this problem too, I’ve created a new Repo on my Windows 10 Github Desktop, and it won’t upload some directories (e.g. build, lib) to github.com, the
directory lib only has one binary file, can someone help how to solve this problem? Thanks,

2 Likes

program-lucky
#16 May 23, 2020, 5:45am

Thanks man, It worked.

1 Like

jean-laurore
#17 May 23, 2020, 5:45am

My Error:

remote: Permission to Jean-Laurore/BookLibrary.git denied to jelaurore.

fatal: unable to access ‘https://github.com/Jean-Laurore/BookLibrary.git/’: The requested URL returned error: 403

1 Like

sahumanika
#18 May 23, 2020, 5:45am

Using the ‘Upload files’ button allows uploading fewer than 100 files.

Try GIT Bash, use the following codes to upload the whole folder.

1. Open Git Bash.


2. CD projectname
3. $ git init
4. $ git add .
5. $ git commit -m “First commit”
6. $ git remote add origin remote repository URL
7. $ git remote -v [Note: Verifies the new remote URL]
https://github.community/t/how-to-upload-an-entire-folder/1056/print 4/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community
8. $ git push origin master

Thank you!

Manika Sahu

10 Likes

sanyaahmed7
#19 May 23, 2020, 5:45am

Hey there, how can I set repository in cmd when my git folder lies on desktop?

1 Like

gurjinderbassi
#21 May 23, 2020, 5:45am

But it doesn’t allow to upload files larger than 25 Mb

1 Like

apawar101
#22 May 23, 2020, 5:45am

Thanks @matelaszlototh This worked like a charm!!

1 Like

tranqv
#23 May 23, 2020, 5:45am

It’s too complicated for a very very simple task.  I have followed these commands and got failed. So funny.

3 Likes

tranqv
#24 May 23, 2020, 5:45am

yeah, but you need a rat move.

https://github.community/t/how-to-upload-an-entire-folder/1056/print 5/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community
It is not benefit for ones who rely mainly on command lines and work without a desktop environment.

2 Likes

dazzz13
#25 May 23, 2020, 5:45am

This didn’t work for me,… it wanted less than 100 files. I tried to do it manually because it would push my latest changes. Well, it said it did, but it was only
pushing up my git attributes.

3 Likes

misc544
#26 July 21, 2020, 7:26pm

If you want to upload an entire file, I think you might read this:Adding a file to a repository

1 Like

misc544
#27 July 21, 2020, 7:30pm

Oh thanks @tranqv !!!

tanya1902
#28 July 22, 2020, 2:53pm

Hello! I would tell everyone reading this thread that drag and drop works very well even if you have other folders in that folder…it might not be working
previously but it works from 2020 onwards.

1 Like

tomson569
#29 August 25, 2020, 2:50am

It worked.
Thank you so much

1 Like

https://github.community/t/how-to-upload-an-entire-folder/1056/print 6/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community

tomson569
#30 August 25, 2020, 3:41pm

thank you.

ffarchiver
#31 September 2, 2020, 10:38pm

For some reason Git Bash (on windows) didn’t like my LFs so now its replacing my 696,424 .txt files with CRLF ones…

1 Like

Yucatanwebpages
#33 November 5, 2020, 5:33am

It does not work for me too…

1 Like

UP930714
#34 November 5, 2020, 7:25pm

You need to have a file within the folder, thats how I got it to work

hmdismail
#35 November 15, 2020, 8:47am

Awesome! works well with folders containing thousandsss

Merlin687
#36 November 21, 2020, 7:21am

Hey, I used the same commands but got error while push origin master:

fatal : 'origin' does not appear to be a git repository

fatal : Could not read from remote repository.

https://github.community/t/how-to-upload-an-entire-folder/1056/print 7/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community
Please make sure you have you have the correct access rights

and the repository exists

Any suggestions?

KrishnaChaitanya-Gopaluni
#37 November 23, 2020, 5:39pm

Thanks, it worked. This is easiest way for quick updates.

airtower-luna
#38 November 23, 2020, 5:50pm

That sound like you don’t have the origin remote configured correctly. The right settings will depend on which repository you’re using and how you’re
authenticating. For general help with remotes, see:

Git - Working with Remotes

duyplus
#39 December 16, 2020, 10:19pm

Try GIT Bash, use the following codes to upload the whole folder.

Open Git Bash.


cd projectname
git init
git remote add origin https://github.com/<username>/<repo>.git
git remote -v (for checking current repository)
git add -A (add all files)
git commit -m 'Add files via upload'
git pull --rebase origin master
git push origin master

1 Like

https://github.community/t/how-to-upload-an-entire-folder/1056/print 8/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community

sjudenim
#41 January 31, 2021, 10:00pm

Is drag and drop no longer working on the web ui? I can no longer drag files or folders. It worked fine before so I’m not sure if it’s a conflict with my browser or
not. I’ve tried Vivaldi (Chromium) and Edge.

ps. site word filtering is awful, (someting) try spelling it correctly. smh

gagandua078
#42 April 23, 2021, 10:59am

Try Using Github Desktop select your repository files and push the repo

SheikAhamedIqbal2005
#43 April 23, 2021, 12:23pm

Just Drag it in the Upload area. It will upload and make a new folder for you.

It works for me , Using Mozilla Firefox

masoodbinmohammad
#44 May 14, 2021, 1:07pm

Just download github desktop and it is pretty easier to push the changes if you want to avoid playing with command line

hidaytraj
#45 June 24, 2021, 1:55pm

I was also having issue by drag and drop option.

But only in case of one file was empty. due to that culprit file it wasn’t allowing me to upload rest of the files.

whether you can delete or add some content in the empty file and try to upload. should work fine

25yeht
#46 June 29, 2021, 5:05pm

I’m on a chromebook and I can only access github via chrome.

https://github.community/t/how-to-upload-an-entire-folder/1056/print 9/10
06/09/2021, 19:13 How to upload an entire folder? - How to use Git and GitHub - GitHub Support Community

25yeht
#47 June 29, 2021, 5:06pm

Also, I can’t run bash on a chromebook.

Sk05062003
#48 July 17, 2021, 6:12pm

Thanks a lot. It is helping me a lot.

© 2021 GitHub, Inc. Terms Privacy Security Status Docs Contact GitHub API Training Shop Blog About

https://github.community/t/how-to-upload-an-entire-folder/1056/print 10/10

You might also like