I’d like to mention that I work with WSL (Windows Subsystem for Linux). Like I mentioned above, I was a contributor on a repository that later on, was either deleted, or I was removed from. I have the code on my computer, and I want to push it to a new github repository. I dont know how to do that.
Github does give you the option to upload files, but not entire folders, and I’m not sure how to upload things like the entire node_modules folder and its countless subfolders there. Please help this is incredibly frustrating.
I tried to upload files but quickly realized I won’t be able to upload the entire folder structure. Then I downloaded Github’s desktop client to try to make a repository out of the local folder itself, but it tells me that another user on my PC has access to this repository and hence I can’t create another one out of it.
Another thing I tried was copying the entire repository folder from the WSL file system to my Desktop, which didn’t work either. It just wouldn’t copy all files. About a dozen files couldn’t be moved.
2
Answers
If you create a new repository on GitHub, then they will walk you through how to upload an existing repository’s contents. (Don’t create a README in GitHub’s interface until after you’ve pushed old code, if ever.)
The steps are:
git push origin main
(to push just themain
branch) orgit push origin --branches
(to push all branches)if you get an error on push, this is probably because you created that "README" file in your new repo, just run
git push --force ...