How to upload folders on GitHub

前端 未结 3 1515
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-02 06:32

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

相关标签:
3条回答
  • 2021-02-02 06:54

    This is Web GUI of a GitHub repository:

    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.

    and add commit message

    And press button Commit changes is the last step.

    0 讨论(0)
  • 2021-02-02 06:55

    I've just gone through that process again. Always end up cloning the repo locally, upload the folder I want to have in that repo to that cloned location, commit the changes and then push it.

    Note that if you're dealing with large files, you'll need to consider using something like Git LFS.

    0 讨论(0)
  • 2021-02-02 06:57

    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  
    
    0 讨论(0)
提交回复
热议问题