I want to add a project to a folder in a repository in GitHub, using GitBash. The ideea is to have a repository for university and have different folders for every programming language, where I would store the projects I do.
I used the basic commands in Git to add the project to a repository in GitHub, but that means I have to create a new repository for every project I do… I tried using the same commands but with the URL from the folder inside the repo, in the end it returns this error: fatal: unable to access ‘https://github.com/…’: URL rejected: Malformed input to a URL function
Andrei Pușcaș is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
GitHub allows for unlimited private repositories. You’ll have a way better time managing one repository per project rather than putting everything in the same repository. Especially if you want to add automation like CI/CD etc.
Furthermore, if you are a student, GitHub does have specific offer for students. You might wanna check if you’re eligible for this, as it will give you access to GitHub pro, and better usage of the kind of tools I’ve mentioned above.
If after all this, you still want to use a single repository for all your project, then adding a new folder to a git repository is just running a new git add <path>
then commit and push as usual.
Your folder needs to be located at the root of your repository when you are doing this, you cannot add a directory that is outside of the project root.